aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-05-21 22:24:02 +0200
committerlonkaars <loek@pipeframe.xyz>2021-05-21 22:24:02 +0200
commit3565d8c5bfeae0b9ce7fd25d83fadbf5a1747048 (patch)
tree8ca64a983e8801ffdaeb860b97ed438d89987483
parenta6d27ae3209da846f9fb6aa7166979e05780b1bf (diff)
timeline cursor moves with video again :tada:
-rw-r--r--pages/editor.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/pages/editor.tsx b/pages/editor.tsx
index 838da2c..7a7a52b 100644
--- a/pages/editor.tsx
+++ b/pages/editor.tsx
@@ -65,7 +65,7 @@ function TimelineEditor(props: {
var timelineLabels = useTimelineLabels((st: any) => st.labels);
var setTimelineLabels = useTimelineLabels((st: any) => st.setLabels);
- var frame = useFrame((st: any) => st.currentFrame);
+ // var frame = useFrame((st: any) => st.currentFrame);
var setFrame = useFrame((st: any) => st.setFrame);
var timelineZoom = getTimelineZoom((st: any) => st.zoom);
@@ -76,6 +76,7 @@ function TimelineEditor(props: {
props.player.addEventListener('TimedVideoPlayerOnFrame', (event: CustomEvent) => {
setFrame(event.detail);
+ scrubberSpring.start({ frame: event.detail });
});
var css = (varname: string) => getComputedStyle(document.body).getPropertyValue(varname).trim();
@@ -164,7 +165,7 @@ function TimelineEditor(props: {
useDrag(({ xy: [x, _y] }) => {
var frame = Math.max(0, Math.round(getFrameAtOffset(x - 240, timelineZoom)) - 1);
setFrame(frame);
- return scrubberSpring.start({ frame });
+ scrubberSpring.start({ frame });
}, { domTarget: scrubberDragRef, eventOptions: { passive: false } });
return <>