aboutsummaryrefslogtreecommitdiff
path: root/pages/editor.tsx
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-05-20 11:40:24 +0200
committerlonkaars <loek@pipeframe.xyz>2021-05-20 11:40:24 +0200
commitc4923c2a1f37c735f869ea91cd375bfd67ffd02c (patch)
tree728c87d4acd6da9bc2482f3f3efa0405107b0d3a /pages/editor.tsx
parent45f5435761612dd6c171b47e4e3a948128501ffe (diff)
use CustomEvent instead of janky TimedVideoPlayer.onframe method
Diffstat (limited to 'pages/editor.tsx')
-rw-r--r--pages/editor.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/pages/editor.tsx b/pages/editor.tsx
index 81a0c66..cb68601 100644
--- a/pages/editor.tsx
+++ b/pages/editor.tsx
@@ -63,10 +63,9 @@ function TimelineEditor(props: {
var canvas = document.getElementById('timeScaleCanvas') as HTMLCanvasElement;
var ctx = canvas.getContext('2d');
- function onframe(frame: number) {
- setFrame(frame);
- }
- props.player.onframe = onframe;
+ props.player.addEventListener('TimedVideoPlayerOnFrame', (event: CustomEvent) => {
+ setFrame(event.detail);
+ });
var css = (varname: string) => getComputedStyle(document.body).getPropertyValue(varname).trim();
var baseColor = css('--c100');