aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/VideoBox.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-07-23 22:11:09 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-07-23 22:11:09 -0400
commit7c2454f14eeb40c0dee6a5fefed1c954012181bb (patch)
treef69ab897f0af693e9c10a9adde32f0108e916006 /src/client/views/nodes/VideoBox.tsx
parentcb95d4b43238538f59babcaa0b0d9dabb9b393b7 (diff)
parent7f9e4de6e4b5d06535c5dfc93afa707a355a353d (diff)
merged with master
Diffstat (limited to 'src/client/views/nodes/VideoBox.tsx')
-rw-r--r--src/client/views/nodes/VideoBox.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx
index 5624d41a9..30ad75000 100644
--- a/src/client/views/nodes/VideoBox.tsx
+++ b/src/client/views/nodes/VideoBox.tsx
@@ -59,7 +59,7 @@ export class VideoBox extends DocComponent<FieldViewProps, VideoDocument>(VideoD
this.Playing = true;
update && this.player && this.player.play();
update && this._youtubePlayer && this._youtubePlayer.playVideo();
- !this._playTimer && (this._playTimer = setInterval(this.updateTimecode, 5));
+ this._youtubePlayer && !this._playTimer && (this._playTimer = setInterval(this.updateTimecode, 5));
this.updateTimecode();
}
@@ -72,7 +72,7 @@ export class VideoBox extends DocComponent<FieldViewProps, VideoDocument>(VideoD
this.Playing = false;
update && this.player && this.player.pause();
update && this._youtubePlayer && this._youtubePlayer.pauseVideo();
- this._playTimer && clearInterval(this._playTimer);
+ this._youtubePlayer && this._playTimer && clearInterval(this._playTimer);
this._playTimer = undefined;
this.updateTimecode();
}
@@ -114,6 +114,7 @@ export class VideoBox extends DocComponent<FieldViewProps, VideoDocument>(VideoD
setVideoRef = (vref: HTMLVideoElement | null) => {
this._videoRef = vref;
if (vref) {
+ this._videoRef!.ontimeupdate = this.updateTimecode;
vref.onfullscreenchange = action((e) => this._fullScreen = vref.webkitDisplayingFullscreen);
if (this._reactionDisposer) this._reactionDisposer();
this._reactionDisposer = reaction(() => this.props.Document.curPage, () =>