diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-08-28 17:43:04 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-08-28 17:43:04 +0200 |
| commit | 1b48663dd1a2dffc0f06e6a072a3a9f0925081a0 (patch) | |
| tree | 2d144b2ca4589aca75bc03dcd404a129e0512345 /animism-align/frontend/app/views/viewer/player/player.container.js | |
| parent | 00f4f6685881d72fd98020aac69d34e87345b3d8 (diff) | |
properly seek to media in transcript
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() } |
