summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/player.container.js
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/player.container.js')
-rw-r--r--animism-align/frontend/app/views/viewer/player/player.container.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/animism-align/frontend/app/views/viewer/player/player.container.js b/animism-align/frontend/app/views/viewer/player/player.container.js
index 9655955..cc9c401 100644
--- a/animism-align/frontend/app/views/viewer/player/player.container.js
+++ b/animism-align/frontend/app/views/viewer/player/player.container.js
@@ -10,7 +10,8 @@ import PlayerFullscreen from './player.fullscreen'
class PlayerContainer extends Component {
componentDidMount() {
// console.log(this.props.sections)
- actions.viewer.setCurrentSection(this.props.sections[0])
+ const { sections } = this.props
+ actions.viewer.setCurrentSection(sections[0], sections[1])
}
componentDidUpdate(prevProps) {
@@ -25,17 +26,18 @@ class PlayerContainer extends Component {
return
}
- const insideSection = sections.some(section => {
+ const insideSection = sections.some((section, i) => {
if (floatInRange(section.start_ts, play_ts, section.end_ts)) {
if (currentSection !== section) {
- actions.viewer.setCurrentSection(section)
+ const nextSection = sections[i+1]
+ actions.viewer.setCurrentSection(section, nextSection)
}
return true
}
return false
})
if (!insideSection) {
- actions.viewer.setCurrentSection(sections[0])
+ actions.viewer.setCurrentSection(sections[0], sections[1])
}
}