diff options
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js b/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js index e43c7ec..10677dc 100644 --- a/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js +++ b/animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js @@ -47,15 +47,17 @@ class VideoScrubber extends Component { this.defer = false } scrub(x, scrubbing) { - const { timing, start_ts, video_start_ts, onScrub, duration } = this.props + const { timing, start_ts, video_start_ts, onScrub, onToggle, duration, scrubMasterAudio } = this.props const bounds = this.scrubberRef.current.getBoundingClientRect() // get percent offset from the scrubber const percent = clamp((x - bounds.left) / bounds.width, 0, 1) // this offset in seconds based on the length of the fullscreen element const seconds = percent * duration // we can use this to seek the audio - actions.audio.seek(start_ts + seconds) - actions.audio.play() + if (scrubMasterAudio) { + actions.audio.seek(start_ts + seconds) + actions.audio.play() + } // apply the video start offset. // in case the video loops, modulo the length of the original video const video_seek = ((seconds + video_start_ts) % timing.duration) @@ -104,7 +106,7 @@ class VideoScrubber extends Component { clearTimeout(this.hideTimeout) } render() { - const { playing, start_ts, play_ts, volume, timing, video_start_ts, duration, cc, mediaItem } = this.props + const { playing, start_ts, play_ts, volume, timing, video_start_ts, duration, cc, mediaItem, onToggle } = this.props const { hovering, showing } = this.state // remove video start offset from timing // console.log(start_ts, play_ts) @@ -119,7 +121,7 @@ class VideoScrubber extends Component { return ( <div className={className}> <div className='start-controls'> - <PlayButton playing={playing} /> + <PlayButton playing={playing} onClick={onToggle} /> </div> <div className='scrub-bar-container' @@ -153,7 +155,6 @@ class VideoScrubber extends Component { } const mapStateToProps = state => ({ - playing: state.audio.playing, volume: state.audio.volume, cc: state.audio.cc, }) |
