Spaces:
Running
Running
Upload 51 files
Browse files
src/components/MultiSourceCaptioningView.tsx
CHANGED
@@ -117,6 +117,12 @@ export default function MultiSourceCaptioningView() {
|
|
117 |
};
|
118 |
}, [videoRef, overlayVideoRef, uploadedUrl, videoUrl, mode]);
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
const processVideoFrame = async () => {
|
121 |
if (!processingVideoRef.current || !canvasRef.current) return;
|
122 |
const video = processingVideoRef.current;
|
@@ -420,6 +426,7 @@ export default function MultiSourceCaptioningView() {
|
|
420 |
muted
|
421 |
playsInline
|
422 |
style={{ display: "none" }}
|
|
|
423 |
/>
|
424 |
<canvas
|
425 |
ref={canvasRef}
|
@@ -515,6 +522,7 @@ export default function MultiSourceCaptioningView() {
|
|
515 |
muted
|
516 |
playsInline
|
517 |
style={{ display: "none" }}
|
|
|
518 |
/>
|
519 |
<canvas
|
520 |
ref={canvasRef}
|
@@ -553,6 +561,7 @@ export default function MultiSourceCaptioningView() {
|
|
553 |
muted
|
554 |
playsInline
|
555 |
style={{ display: "none" }}
|
|
|
556 |
/>
|
557 |
<canvas
|
558 |
ref={canvasRef}
|
|
|
117 |
};
|
118 |
}, [videoRef, overlayVideoRef, uploadedUrl, videoUrl, mode]);
|
119 |
|
120 |
+
useEffect(() => {
|
121 |
+
if ((mode === "URL" || mode === "File") && processingVideoRef.current) {
|
122 |
+
processingVideoRef.current.play().catch(() => {});
|
123 |
+
}
|
124 |
+
}, [mode, videoUrl, uploadedUrl]);
|
125 |
+
|
126 |
const processVideoFrame = async () => {
|
127 |
if (!processingVideoRef.current || !canvasRef.current) return;
|
128 |
const video = processingVideoRef.current;
|
|
|
426 |
muted
|
427 |
playsInline
|
428 |
style={{ display: "none" }}
|
429 |
+
onLoadedData={e => { e.currentTarget.play().catch(() => {}); }}
|
430 |
/>
|
431 |
<canvas
|
432 |
ref={canvasRef}
|
|
|
522 |
muted
|
523 |
playsInline
|
524 |
style={{ display: "none" }}
|
525 |
+
onLoadedData={e => { e.currentTarget.play().catch(() => {}); }}
|
526 |
/>
|
527 |
<canvas
|
528 |
ref={canvasRef}
|
|
|
561 |
muted
|
562 |
playsInline
|
563 |
style={{ display: "none" }}
|
564 |
+
onLoadedData={e => { e.currentTarget.play().catch(() => {}); }}
|
565 |
/>
|
566 |
<canvas
|
567 |
ref={canvasRef}
|