diff options
author | bob <bcz@cs.brown.edu> | 2019-07-15 10:41:31 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-07-15 10:41:31 -0400 |
commit | 27fc2cce30d990502f7836054eb15e24f51e709c (patch) | |
tree | d94c786ce7473609f7090107eb51e6de44a58731 | |
parent | 023ae2e35a49128eaa12d9cccd27b7ca0e502545 (diff) |
fixed annotation & time code updating.
-rw-r--r-- | src/client/views/nodes/VideoBox.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index e86348241..66844cdd6 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -44,12 +44,13 @@ export class VideoBox extends DocComponent<FieldViewProps, VideoDocument>(VideoD } } - @action public Play() { + @action public Play = () => { this.Playing = true; this.player && this.player.play(); this._youtubePlayer && this._youtubePlayer.playVideo(); !this._playTimer && (this._playTimer = setInterval(this.updateTimecode, 500)); this._youtubeSeekTo = false; + this.updateTimecode(); } @action public Seek(time: number) { @@ -59,7 +60,7 @@ export class VideoBox extends DocComponent<FieldViewProps, VideoDocument>(VideoD } } - @action public Pause() { + @action public Pause = () => { this.Playing = false; this.player && this.player.pause(); this._youtubePlayer && this._youtubePlayer.pauseVideo(); @@ -176,7 +177,7 @@ export class VideoBox extends DocComponent<FieldViewProps, VideoDocument>(VideoD let interactive = InkingControl.Instance.selectedTool || !this.props.isSelected() ? "" : "-interactive"; let style = "videoBox-content" + (this._fullScreen ? "-fullScreen" : "") + interactive; return !field ? <div>Loading</div> : - <video className={`${style}`} ref={this.setVideoRef} onCanPlay={this.videoLoad} controls={VideoBox._showControls}> + <video className={`${style}`} ref={this.setVideoRef} onCanPlay={this.videoLoad} controls={VideoBox._showControls} onPlay={this.Play} onSeeked={this.updateTimecode} onPause={this.Pause}> <source src={field.url.href} type="video/mp4" /> Not supported. </video>; |