Fix webcam speed region sync

This commit is contained in:
wizardAEI
2026-05-03 18:32:02 +08:00
parent 6b3c7e4209
commit 57a070d615
@@ -1352,8 +1352,9 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
? Math.min(1 / 60, webcamDuration)
: targetTime;
const timelineTimeMs = currentTime * 1000;
const activeSpeedRegion = speedRegionsRef.current.find(
(region) => targetTime * 1000 >= region.startMs && targetTime * 1000 < region.endMs,
(region) => timelineTimeMs >= region.startMs && timelineTimeMs < region.endMs,
);
const targetPlaybackRate = activeSpeedRegion ? activeSpeedRegion.speed : 1;
if (Math.abs(webcamVideo.playbackRate - targetPlaybackRate) > 0.001) {