diff options
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 | 16 |
1 files changed, 3 insertions, 13 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 9e43c32..1c82e0d 100644 --- a/animism-align/frontend/app/views/viewer/player/player.container.js +++ b/animism-align/frontend/app/views/viewer/player/player.container.js @@ -12,12 +12,14 @@ class PlayerContainer extends Component { super(props) this.handleKeyDown = this.handleKeyDown.bind(this) } + componentDidMount() { // console.log(this.props.sections) const { sections } = this.props actions.viewer.setCurrentSection(sections[0], sections[1]) document.addEventListener('keydown', this.handleKeyDown) } + componentWillUnmount() { document.removeEventListener('keydown', this.handleKeyDown) } @@ -74,19 +76,7 @@ class PlayerContainer extends Component { } if (autoAdvance) { - const insideSection = sections.some((section, i) => { - if (floatInRange(section.start_ts, play_ts, section.end_ts)) { - if (currentSection !== section) { - const nextSection = sections[i+1] - actions.viewer.setCurrentSection(section, nextSection) - } - return true - } - return false - }) - if (!insideSection) { - actions.viewer.setCurrentSection(sections[sections.length-1], null) - } + actions.viewer.setSectionFromTimestamp(play_ts) } else { actions.viewer.reachedEndOfSection() } |
