aboutsummaryrefslogtreecommitdiff
path: root/pages/present.tsx
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2021-05-24 15:23:04 +0200
committerlonkaars <loek@pipeframe.xyz>2021-05-24 15:23:04 +0200
commit7469afab31ebfdd2d447c351d615b7c1d8e42c2e (patch)
tree3555df0abe4c1e207dc48b3657bf903c220e446e /pages/present.tsx
parent79a7317bf18db757d9b9ec38021635c1b4cf31dc (diff)
tool selection and play/skip animation
Diffstat (limited to 'pages/present.tsx')
-rw-r--r--pages/present.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/pages/present.tsx b/pages/present.tsx
index 9769577..2ad8f72 100644
--- a/pages/present.tsx
+++ b/pages/present.tsx
@@ -89,7 +89,7 @@ export class TimedVideoPlayer {
case 'delay': {
this.player.playbackRate = 0;
this.slide++;
- var event = new CustomEvent('TimedVideoPlayerSlide', { detail: this.slide });
+ var event = new CustomEvent('TimedVideoPlayerSlide', { detail: this.timeline.slides[this.slide] });
this.dispatchEvent(event);
setTimeout(() => {
this.player.playbackRate = this.getPlaybackSpeed(this.slide - 1);
@@ -98,7 +98,7 @@ export class TimedVideoPlayer {
}
case 'speedChange': {
this.slide++;
- var event = new CustomEvent('TimedVideoPlayerSlide', { detail: this.slide });
+ var event = new CustomEvent('TimedVideoPlayerSlide', { detail: this.timeline.slides[this.slide] });
this.dispatchEvent(event);
this.player.playbackRate = this.framerate / (slide as speedChangeSlide).newFramerate;
break;
@@ -189,10 +189,10 @@ export class TimedVideoPlayer {
if (!this.registeredEventListeners) return;
this.slide++;
- var event = new CustomEvent('TimedVideoPlayerSlide', { detail: this.slide });
- this.dispatchEvent(event);
var slide = this.timeline.slides[this.slide];
+ var event = new CustomEvent('TimedVideoPlayerSlide', { detail: slide });
+ this.dispatchEvent(event);
if (!this.player.paused && this.frame < slide?.frame) {
this.skip();
@@ -206,12 +206,12 @@ export class TimedVideoPlayer {
this.slide = Math.max(this.slide - 1, -1);
- var event = new CustomEvent('TimedVideoPlayerSlide', { detail: this.slide });
- this.dispatchEvent(event);
-
var slide = this.timeline.slides[this.slide];
if (!slide) return;
+ var event = new CustomEvent('TimedVideoPlayerSlide', { detail: slide });
+ this.dispatchEvent(event);
+
this.jumpToSlide(slide);
}
}