From 2d7acc472ee4f4a37556f41a0ea6ffec8b7b0e26 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 24 May 2021 15:42:46 +0200 Subject: player buttons working :tada:g --- pages/editor.tsx | 30 ++++++++++++++++++++++++++---- pages/present.tsx | 3 +-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/pages/editor.tsx b/pages/editor.tsx index 2deb6f5..95b6005 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -466,19 +466,41 @@ export default function Index() {
- } /> + } + onClick={() => { + player.slide = 0; + player.previous(); + }} + /> player.next()} + onClick={() => { + player.next(); + player.player.play(); + }} children={} style={{ '--ani-state': playing ? 'skip' : 'play' } as CSSProperties} /> } onClick={() => player.previous()} /> - } /> + } + onClick={() => { + player.next(); // TODO: fix jank here + player.next(); + player.previous(); + }} + />
- } /> + } + onClick={() => document.body.requestFullscreen()} + />
diff --git a/pages/present.tsx b/pages/present.tsx index 2ad8f72..df32e60 100644 --- a/pages/present.tsx +++ b/pages/present.tsx @@ -197,8 +197,6 @@ export class TimedVideoPlayer { if (!this.player.paused && this.frame < slide?.frame) { this.skip(); } - - this.player.play(); } previous() { @@ -258,6 +256,7 @@ export default function Present() { className='control next' onClick={() => { player.next(); + player.player.play(); rerender(); }} /> -- cgit v1.2.3