diff options
author | lonkaars <loek@pipeframe.xyz> | 2021-05-20 11:40:24 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2021-05-20 11:40:24 +0200 |
commit | c4923c2a1f37c735f869ea91cd375bfd67ffd02c (patch) | |
tree | 728c87d4acd6da9bc2482f3f3efa0405107b0d3a /pages/editor.tsx | |
parent | 45f5435761612dd6c171b47e4e3a948128501ffe (diff) |
use CustomEvent instead of janky TimedVideoPlayer.onframe method
Diffstat (limited to 'pages/editor.tsx')
-rw-r--r-- | pages/editor.tsx | 7 |
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'); |