@bycrux/editor 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -62,6 +62,9 @@ function OverlayVideo({ src, currentTime, itemStart, inPoint, isPlaying, muted,
|
|
|
62
62
|
return (
|
|
63
63
|
<video
|
|
64
64
|
ref={ref}
|
|
65
|
+
// Anonymous CORS so cross-origin R2 clips aren't tainted (would mute the
|
|
66
|
+
// Web Audio graph). crossOrigin must be set before src. R2 sends ACAO.
|
|
67
|
+
crossOrigin="anonymous"
|
|
65
68
|
src={src}
|
|
66
69
|
muted={muted}
|
|
67
70
|
preload="auto"
|
|
@@ -132,6 +132,10 @@ export default function PreviewPlayer({
|
|
|
132
132
|
{/* Slot 0 */}
|
|
133
133
|
<video
|
|
134
134
|
ref={video0Ref}
|
|
135
|
+
// Clips load cross-origin from R2; without this the media is CORS-tainted
|
|
136
|
+
// and the Web Audio createMediaElementSource graph outputs silence. R2
|
|
137
|
+
// sends Access-Control-Allow-Origin, so anonymous CORS keeps it audible.
|
|
138
|
+
crossOrigin="anonymous"
|
|
135
139
|
onLoadedMetadata={(e) => { const v = e.currentTarget; if (v.videoWidth && v.videoHeight) setVideoDims({ w: v.videoWidth, h: v.videoHeight }) }}
|
|
136
140
|
onTimeUpdate={() => { if (activeSlotRef.current === 0) handleTimeUpdate() }}
|
|
137
141
|
onEnded={() => { if (activeSlotRef.current === 0) handleEnded() }}
|
|
@@ -143,6 +147,9 @@ export default function PreviewPlayer({
|
|
|
143
147
|
{/* Slot 1 */}
|
|
144
148
|
<video
|
|
145
149
|
ref={video1Ref}
|
|
150
|
+
// See slot 0: anonymous CORS so R2 cross-origin clips aren't tainted
|
|
151
|
+
// (which would mute the Web Audio graph).
|
|
152
|
+
crossOrigin="anonymous"
|
|
146
153
|
onLoadedMetadata={(e) => { const v = e.currentTarget; if (v.videoWidth && v.videoHeight) setVideoDims({ w: v.videoWidth, h: v.videoHeight }) }}
|
|
147
154
|
onTimeUpdate={() => { if (activeSlotRef.current === 1) handleTimeUpdate() }}
|
|
148
155
|
onEnded={() => { if (activeSlotRef.current === 1) handleEnded() }}
|