Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit fbeb884

Browse files
Fix frames jumps (#487)
Co-authored-by: Max Tkachenko <[email protected]>
1 parent e2f0c73 commit fbeb884

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/VideoCanvas/VideoCanvas.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const VideoCanvas = memo(forwardRef<VideoRef, VideoProps>((props, ref) =>
143143
if (!contextRef.current) return;
144144

145145
const currentTime = videoRef.current?.currentTime ?? 0;
146-
const frameNumber = Math.ceil(currentTime * framerate);
146+
const frameNumber = Math.round(currentTime * framerate);
147147
const frame = clamp(frameNumber, 1, length || 1);
148148
const onChange = props.onFrameChange ?? (() => {});
149149

0 commit comments

Comments
 (0)