diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-10-29 18:10:27 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-10-29 18:10:27 +0100 |
| commit | 6866b02cff0101de6958f10238dbd050e404a87e (patch) | |
| tree | f18047e7c952a3612efcd3218b669a8c7e520dec /animism-align/frontend/app/views/viewer/nav/viewer.router.js | |
| parent | a64e08db0c44e4add7a60b4453a0c570b36f90ea (diff) | |
skip to section plus timestamp
Diffstat (limited to 'animism-align/frontend/app/views/viewer/nav/viewer.router.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/nav/viewer.router.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/animism-align/frontend/app/views/viewer/nav/viewer.router.js b/animism-align/frontend/app/views/viewer/nav/viewer.router.js index e602f4d..53a1f54 100644 --- a/animism-align/frontend/app/views/viewer/nav/viewer.router.js +++ b/animism-align/frontend/app/views/viewer/nav/viewer.router.js @@ -13,9 +13,13 @@ class ViewerRouter extends Component { // console.log(this.props.match.params.component) const { component } = this.props.match.params if (component.match('section_')) { - const sectionIndex = parseInt(component.split('_')[1]) + const sectionParts = component.split('_') + const sectionIndex = parseInt(sectionParts[1]) actions.viewer.seekToSection(getSection(sectionIndex)) - actions.audio.play() + const seek_ts = timestampToSeconds(sectionParts[2]) + if (seek_ts) { + actions.audio.jump(seek_ts) + } return } switch (this.props.match.params.component) { @@ -58,7 +62,7 @@ class ViewerRouter extends Component { actions.viewer.seekToTimestamp(timestampToSeconds('44:39')) break case 'book': - actions.viewer.seekToTimestamp(timestampToSeconds('15:00 ')) + actions.viewer.seekToTimestamp(timestampToSeconds('15:00')) break case 'end': break |
