Open source CapCut alternative.
TypeScript
fix(site): timeline click and trim pause playback
David Le0de91fd2de15
diff --git a/site/src/cut/lib/laneTracks.ts b/site/src/cut/lib/laneTracks.tsindex a9bf0b67..4bda2880 100644--- a/site/src/cut/lib/laneTracks.ts+++ b/site/src/cut/lib/laneTracks.ts@@ -354,7 +354,9 @@ export function startLaneMove<V = unknown>(if (!raw0) return;const self = ad.view(raw0);s.select({ kind: laneSelectionKind(kind), id });- // Clicking anywhere on the timeline moves the playhead — bars included.+ // Clicking anywhere on the timeline pauses and moves the playhead — bars+ // included; otherwise playback rolls right past the point just picked.+ if (s.playing) s.setPlaying(false);s.seek((ui.visStart ?? self.start) +(e.clientX - e.currentTarget.getBoundingClientRect().left) / ui.pps@@ -582,6 +584,8 @@ export function startLaneTrim(if (!raw0) return;const self = ad.view(raw0);s.select({ kind: laneSelectionKind(kind), id });+ // Grabbing an edge pauses playback so the trim isn't fighting a moving playhead.+ if (s.playing) s.setPlaying(false);s.pushHistory();const targets = snapTargets(s, kind, id);const tol = SNAP_PX / ui.pps;