diff options
author | bob <bcz@cs.brown.edu> | 2019-07-22 15:34:40 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-07-22 15:34:40 -0400 |
commit | 872d5b1ddd8868d316b0775317a73a04de8c240b (patch) | |
tree | d9f68503ac85d54de17f1e1ea9b94e4a9b200d3f /src | |
parent | 8db50c6ba0be83b85c896043da53e40c17523e90 (diff) |
added duration for videos and changed the timer to 5 milliseconds.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/VideoBox.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 0f2d18f6b..83ad2a3b3 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -52,13 +52,14 @@ export class VideoBox extends DocComponent<FieldViewProps, VideoDocument>(VideoD this.Document.nativeHeight = this.Document.nativeWidth / aspect; this.Document.height = FieldValue(this.Document.width, 0) / aspect; } + if (!this.Document.duration) this.Document.duration = this.player!.duration; } @action public Play = (update: boolean = true) => { this.Playing = true; update && this.player && this.player.play(); update && this._youtubePlayer && this._youtubePlayer.playVideo(); - !this._playTimer && (this._playTimer = setInterval(this.updateTimecode, 500)); + !this._playTimer && (this._playTimer = setInterval(this.updateTimecode, 5)); this.updateTimecode(); } |