good catch. Stopping seek is timeline seeking only

This commit is contained in:
Alan Trebugeais
2026-05-07 14:14:47 +02:00
parent a013e92f56
commit cfabfd77b4
+7 -3
View File
@@ -3274,18 +3274,22 @@ export default function VideoEditor() {
setAutoSuggestZoomsTrigger(0);
}, []);
function handleSeek(time: number) {
function handleSeek(time: number, options: { pause?: boolean } = {}) {
const playback = videoPlaybackRef.current;
const video = playback?.video;
if (!video) return;
if (!video.paused) {
if (options.pause && !video.paused) {
playback?.pause();
}
video.currentTime = mapTimelineTimeToSourceTime(time * 1000) / 1000;
}
const handleTimelineSeek = useCallback((time: number) => {
handleSeek(time, { pause: true });
}, []);
const handleSelectZoom = useCallback((id: string | null) => {
setSelectedZoomId(id);
if (id) {
@@ -6271,7 +6275,7 @@ export default function VideoEditor() {
videoDuration={duration}
currentTime={currentTime}
playheadTime={timelinePlayheadTime}
onSeek={handleSeek}
onSeek={handleTimelineSeek}
videoPath={videoPath}
cursorTelemetry={normalizedCursorTelemetry}
autoSuggestZoomsTrigger={autoSuggestZoomsTrigger}