From 5e07224b4bf5010b96f745441b6ee4c213d3fb81 Mon Sep 17 00:00:00 2001
From: lonkaars <loek@pipeframe.xyz>
Date: Mon, 24 May 2021 11:26:11 +0200
Subject: dragging keyframe affects timeline :tada:

---
 pages/present.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'pages/present.tsx')

diff --git a/pages/present.tsx b/pages/present.tsx
index f5955fc..9769577 100644
--- a/pages/present.tsx
+++ b/pages/present.tsx
@@ -58,6 +58,9 @@ export class TimedVideoPlayer {
 	jumpToFrame(frame: number) {
 		this.player.currentTime = this.frameToTimestamp(frame);
 		this.frame = frame;
+
+		var event = new CustomEvent('TimedVideoPlayerOnFrame', { detail: this.frame });
+		this.dispatchEvent(event);
 	}
 
 	jumpToSlide(slide: slide) {
@@ -128,7 +131,6 @@ export class TimedVideoPlayer {
 		setInterval(() => {
 			if (this.player.paused) return;
 
-			var lastFrame = this.frame;
 			this.frame = this.timestampToFrame(this.player.currentTime);
 
 			var event = new CustomEvent('TimedVideoPlayerOnFrame', { detail: this.frame });
@@ -169,6 +171,7 @@ export class TimedVideoPlayer {
 		this.framerate = this.timeline.framerate;
 
 		this.timeline.slides[-1] = {
+			id: '00000000-0000-0000-0000-000000000000',
 			frame: 0,
 			type: 'default',
 			clickThroughBehaviour: 'ImmediatelySkip',
@@ -202,6 +205,7 @@ export class TimedVideoPlayer {
 		if (!this.registeredEventListeners) return;
 
 		this.slide = Math.max(this.slide - 1, -1);
+
 		var event = new CustomEvent('TimedVideoPlayerSlide', { detail: this.slide });
 		this.dispatchEvent(event);
 
-- 
cgit v1.2.3

