diff --git a/tl/src/tl/views.cljs b/tl/src/tl/views.cljs index 2aaf21f..99b56bb 100644 --- a/tl/src/tl/views.cljs +++ b/tl/src/tl/views.cljs @@ -39,13 +39,14 @@ target (-> (- px (/ (.-clientWidth el) 2)) (max 0) (min max-sl))] (set! (.-scrollLeft el) target)))) +;; Moving the playhead = seeking the video. The video is the single clock +;; (video-monitor's rAF reads currentTime back into :playhead), so we never +;; write :playhead directly — we just move the video and let it report back. (defn- seek-to-frame! [fps frames] (when-let [v @video-el] (set! (.-currentTime v) (secs frames fps)))) -(defn- jump! [fps frame] - (rf/dispatch [::events/set-playhead frame]) - (seek-to-frame! fps frame)) +(defn- jump! [fps frame] (seek-to-frame! fps frame)) (defn- jump-and-scroll! "Jump (seek video + move playhead) AND scroll the timeline to center the frame." @@ -142,28 +143,42 @@ (.addEventListener js/document "keydown" on-keydown) (defn video-monitor - "Native-controls