diff options
Diffstat (limited to 'animism-align/frontend')
4 files changed, 15 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 6c61223..27ff7a1 100644 --- a/animism-align/frontend/app/views/viewer/nav/viewer.router.js +++ b/animism-align/frontend/app/views/viewer/nav/viewer.router.js @@ -22,6 +22,11 @@ class ViewerRouter extends Component { } return } + if (component.match('timestamp_')) { + const timestampParts = component.split('_') + actions.viewer.seekToTimestamp(timestampToSeconds(timestampParts[1])) + return + } switch (this.props.match.params.component) { case 'transcript': actions.viewer.showComponent('transcript') diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js index 39aa9f8..ef98533 100644 --- a/animism-align/frontend/app/views/viewer/viewer.actions.js +++ b/animism-align/frontend/app/views/viewer/viewer.actions.js @@ -113,7 +113,6 @@ export const loadSections = () => dispatch => { } // build timeline of "cue" instructions, which tell elements to change - // TODO: modify this to append these instructions to a list based on media_id, so we can grab it for the gallery if (CUE_UTILITY_ANNOTATION_TYPES.has(annotation.type)) { if (annotation.type === 'gallery_advance') { annotation.settings.frame_index = parseInt(annotation.settings.frame_index) diff --git a/animism-align/frontend/site/app.js b/animism-align/frontend/site/app.js index 8509954..ac232ce 100644 --- a/animism-align/frontend/site/app.js +++ b/animism-align/frontend/site/app.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' -import { ConnectedRouter } from 'connected-react-router' -import { Route } from 'react-router' +// import { ConnectedRouter } from 'connected-react-router' +// import { Route } from 'react-router' // import ViewerContainer from './viewer/viewer.container' import Viewer from 'app/views/viewer/viewer.container' diff --git a/animism-align/frontend/site/site/site.actions.js b/animism-align/frontend/site/site/site.actions.js index ff25484..4767619 100644 --- a/animism-align/frontend/site/site/site.actions.js +++ b/animism-align/frontend/site/site/site.actions.js @@ -15,6 +15,14 @@ export const loadProject = () => dispatch => { loadFonts(), ]).then(() => { actions.viewer.loadSections() + if (window.location.hash.length) { + const hash = window.location.hash.substr(1) + const hashParts = hash.split('=') + if (hashParts.length !== 2) return + if (hashParts[0] === 'ts') { + actions.viewer.seekToTimestamp(parseFloat(hashParts[1])) + } + } }).catch(err => { console.error(err) }) |
