Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into bug-fix/sequence

Shankhadeep Dey03a9e7eaee22
diff --cc packages/core/src/video/VideoForDevelopment.tsx
index 83ac358b08,a02c62f7dd..59dd5bf713
--- a/packages/core/src/video/VideoForDevelopment.tsx
+++ b/packages/core/src/video/VideoForDevelopment.tsx
@@@ -26,10 -26,17 +27,17 @@@ export const VideoForDevelopment: React
if (!videoConfig) {
throw new Error('No video config found');
}
- if (!playing || currentFrame === 0 || absoluteFrame === 0) {
+
- if (!playing) {
++ if (!playing || absoluteFrame === 0) {
+ videoRef.current.currentTime = currentFrame / (1000 / videoConfig.fps);
+ return;
+ }
+
+ if (videoRef.current.paused) {
videoRef.current.currentTime = currentFrame / (1000 / videoConfig.fps);
+ videoRef.current.play();
}
- }, [currentFrame, playing, videoConfig]);
+ }, [currentFrame, playing, videoConfig, absoluteFrame]);
return <video ref={videoRef} muted {...props} />;
};