diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-08-07 22:59:03 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-08-07 22:59:03 +0200 |
| commit | 475638e617c5053aeb897d26bfba4c8d1975c614 (patch) | |
| tree | 28762550bf791983e49bd33ec909c79f30f8a09f /animism-align/frontend/app/views/viewer/player/player.container.js | |
| parent | 51abc790cb4952456029db1132c0e8730618afcd (diff) | |
next button
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.js | 10 |
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]) } } |
