From 8aa1776fc33e90157e3b655d696b31e4f9b4d104 Mon Sep 17 00:00:00 2001 From: Riccardo Pallaoro <95774148+pallaoro@users.noreply.github.com> Date: Sat, 14 Nov 2026 10:37:16 +0000 Subject: [PATCH] Preview no longer bounces between two clips at a cut The playhead follows the playing video. When the clip coming in read a little short of its trim at the cut, the playhead landed back on the previous clip, which played on past the cut and handed forward again, so the preview looped at that one cut. The clock now never reads earlier than the clip's own start. --- src/client/edit.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/edit.tsx b/src/client/edit.tsx index 74312c0..9471ae6 100644 --- a/src/client/edit.tsx +++ b/src/client/edit.tsx @@ -3562,7 +3562,13 @@ function Player({ // A paused or starved element is not a clock: let the wall clock carry // on rather than freezing the playhead while the buffer fills. if (!v || v.paused || v.readyState < 2) return null; - return seg.start + (v.currentTime - (seg.el.trimStart ?? 0)); + // Never before the clip's own start. The clip coming in can sit a little + // short of its trim at the cut (a transition's incoming side is only + // nudged into step, and a browser may report a frame early for a trim + // that falls between frames). Read as is, that put the playhead back on + // the previous clip, which played on past the cut and handed back, and + // the preview bounced between the two clips at that one cut. + return Math.max(seg.start, seg.start + (v.currentTime - (seg.el.trimStart ?? 0))); }; return () => { mediaClock.current = null;