aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-05-24 15:42:46 +0200
committerlonkaars <loek@pipeframe.xyz>2021-05-24 15:42:46 +0200
commit2d7acc472ee4f4a37556f41a0ea6ffec8b7b0e26 (patch)
tree92773668ed71c32b1c0bb52c53349b0de081171f
parent7469afab31ebfdd2d447c351d615b7c1d8e42c2e (diff)
player buttons working :tada:g
-rw-r--r--pages/editor.tsx30
-rw-r--r--pages/present.tsx3
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() {
</div>
<div className='controls'>
<div className='posabs abscenter'>
- <Fab size='small' children={<SkipPreviousRoundedIcon />} />
+ <Fab
+ size='small'
+ children={<SkipPreviousRoundedIcon />}
+ onClick={() => {
+ player.slide = 0;
+ player.previous();
+ }}
+ />
<Fab
className='playPause'
size='medium'
- onClick={() => player.next()}
+ onClick={() => {
+ player.next();
+ player.player.play();
+ }}
children={<PlaySkipIconAni />}
style={{ '--ani-state': playing ? 'skip' : 'play' } as CSSProperties}
/>
<Fab size='small' children={<NavigateBeforeRoundedIcon />} onClick={() => player.previous()} />
- <Fab size='small' children={<NavigateNextRoundedIcon />} />
+ <Fab
+ size='small'
+ children={<NavigateNextRoundedIcon />}
+ onClick={() => {
+ player.next(); // TODO: fix jank here
+ player.next();
+ player.previous();
+ }}
+ />
</div>
<div className='posabs abscenterv r0'>
- <Fab size='small' children={<FullscreenRoundedIcon />} />
+ <Fab
+ size='small'
+ children={<FullscreenRoundedIcon />}
+ onClick={() => document.body.requestFullscreen()}
+ />
</div>
</div>
</div>
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();
}}
/>