summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/viewer.actions.js
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.actions.js18
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 })
}