🎥 Make videos programmatically with React
revert VideoForDevelopment
Shankhadeep Dey645fc1f1f655
diff --git a/packages/core/src/video/VideoForDevelopment.tsx b/packages/core/src/video/VideoForDevelopment.tsxindex d01883d5b3..3e026c6166 100644--- a/packages/core/src/video/VideoForDevelopment.tsx+++ b/packages/core/src/video/VideoForDevelopment.tsx@@ -12,6 +12,14 @@ export const VideoForDevelopment: React.FC<RemotionVideoProps> = (props) => {const videoConfig = useUnsafeVideoConfig();const [playing] = usePlayingState();+ useEffect(() => {+ if (playing) {+ videoRef.current?.play();+ } else {+ videoRef.current?.pause();+ }+ }, [playing]);+useEffect(() => {if (!videoRef.current) {throw new Error('No video ref found');@@ -32,7 +40,6 @@ export const VideoForDevelopment: React.FC<RemotionVideoProps> = (props) => {if (!playing || absoluteFrame === 0) {videoRef.current.currentTime = currentTime;- videoRef.current.pause();}if (videoRef.current.paused && !videoRef.current.ended && playing) {