summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/components.media
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-12-02 19:47:59 +0100
committerJules Laplace <julescarbon@gmail.com>2020-12-02 19:47:59 +0100
commite47643e882af47546bb3f9c5560d24c4429a4cf3 (patch)
tree3f4b278dd733616ccb3f3694360d070d150e2a3b /animism-align/frontend/app/views/viewer/player/components.media
parentfa287a8b341926fa3866d7dee31b4f4090a5c98f (diff)
video modal mostly working
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/components.media')
-rw-r--r--animism-align/frontend/app/views/viewer/player/components.media/video.scrubber.js13
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,
})