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.js12
1 files changed, 10 insertions, 2 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 e226bab..adbc22a 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
@@ -40,13 +40,21 @@ class FullscreenVideo extends Component {
})
}
componentDidUpdate(prevProps) {
- if (Math.abs(this.props.play_ts - prevProps.play_ts) > 1.0) {
+ // if the play_ts jumped more than a second, seek
+ const { play_ts, element } = this.props
+ if (Math.abs(play_ts - prevProps.play_ts) > 1.0) {
// handle seek
- const { play_ts, element } = this.props
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 (this.props.isLeaving && this.props.isLeaving !== prevProps.isLeaving && element.settings.unmuted) {
+ this.fadeOutAudio()
+ }
+ }
+ fadeOutAudio() {
+ console.log("fade out audio", this.props.fadeOutDuration)
}
handlePlay() {
this.setState({ ready: true })