summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js')
-rw-r--r--animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js22
1 files changed, 15 insertions, 7 deletions
diff --git a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js
index abdd90a..cacd323 100644
--- a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js
+++ b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js
@@ -43,21 +43,29 @@ class FullscreenVideo extends Component {
}
componentDidUpdate(prevProps) {
// if the play_ts jumped more than a second, seek
- const { play_ts, element } = this.props
+ const { play_ts, element, currentSection } = this.props
if (Math.abs(play_ts - prevProps.play_ts) > 1.0) {
// handle seek
const { duration, video_start_ts } = this.state
const seek = ((play_ts - element.start_ts) % duration) + video_start_ts
this.setState({ seek })
}
- // if we started leaving the element...
- if (element.fadeOutDuration
- && !this.state.fadeOut
- && element.settings.unmuted) {
- // console.log("fade out audio", this.props.fadeOutDuration)
- setTimeout(() => this.setState({ fadeOut: true }), 0)
+ // volume changes - only if unmuted and not already leaving.
+ if (element.settings.unmuted && !this.state.fadeOut) {
+ // if we just started leaving the element, fade out the audio
+ if (element.fadeOutDuration) {
+ // console.log("fade out audio", this.props.fadeOutDuration)
+ setTimeout(() => this.setState({ fadeOut: true }), 0)
+ }
+ // otherwise, check if we gotta set the volume based on the position
+ else if (currentSection.cues.length) {
+ this.checkCuePosition(play_ts, currentSection.cues)
+ }
}
}
+ checkCuePosition() {
+ // if (this.)
+ }
handlePlay() {
this.setState({ ready: true })
}