diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-09-22 15:53:33 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-09-22 15:53:33 +0200 |
| commit | 046aeb54b96a2563395875657fddd062a5c3b4f7 (patch) | |
| tree | b95d3d040ae9355fabe9bcceabeaa83d3788e987 /animism-align/frontend/app/views/viewer/viewer.actions.js | |
| parent | 640c5e6dfc9e854585ed6e71b137cbfca4529e9c (diff) | |
start on scroll
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/viewer.actions.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js index bdf5640..7566968 100644 --- a/animism-align/frontend/app/views/viewer/viewer.actions.js +++ b/animism-align/frontend/app/views/viewer/viewer.actions.js @@ -10,7 +10,7 @@ import { CURTAIN_COLOR_LOOKUP, GROWL, } from 'app/constants' -import { floatInRange } from 'app/utils' +import { floatInRange, timestampToSeconds } from 'app/utils' import { buildParagraphs } from 'app/utils/transcript.utils' import { annotationFadeTimings } from 'app/utils/annotation.utils' import { getNextSection } from 'app/utils/viewer.utils' @@ -111,6 +111,13 @@ export const loadSections = () => dispatch => { // build timeline of special inline items if (INLINE_UTILITY_ANNOTATION_TYPES.has(annotation.type)) { sectionTextAnnotationOrder.push(annotation.id) + if (annotation.type === 'intro') { + if (annotation.settings.intro_start_ts) { + currentSection.intro_start_ts = timestampToSeconds(annotation.settings.intro_start_ts) + } else { + currentSection.intro_start_ts = 0 + } + } } // build timeline of fullscreen events @@ -226,6 +233,15 @@ export const reachedEndOfSection = currentSection => dispatch => { } } +export const playFromClick = () => dispatch => { + const state = store.getState() + if (state.audio.play_ts === 0 && state.viewer.currentSection.intro_start_ts) { + actions.viewer.seekToTimestamp(state.viewer.currentSection.intro_start_ts) + } else { + actions.audio.play() + } +} + export const setCurrentSection = (currentSection, nextSection) => dispatch => { dispatch({ type: types.viewer.set_current_section, currentSection, nextSection }) } |
