summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-11-05 17:08:56 +0100
committerJules Laplace <julescarbon@gmail.com>2020-11-05 17:08:56 +0100
commit6916799d455c74ca18ba2de086983541fa6d3fc6 (patch)
tree728295cd0413a9e3def94562b0a9b7c973fa6212 /animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.video.js
parent314d1ac4bfe2916e82edae75e16e363ef6863210 (diff)
introducing stuff for fading in audio
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 })