diff options
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/viewer.actions.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js index 1113680..a5ac4a2 100644 --- a/animism-align/frontend/app/views/viewer/viewer.actions.js +++ b/animism-align/frontend/app/views/viewer/viewer.actions.js @@ -1,12 +1,12 @@ import * as types from 'app/types' -import { store, history, dispatch } from 'app/store' +import { store } from 'app/store' import actions from 'app/actions' import { MEDIA_ANNOTATION_TYPES, MEDIA_LABEL_TYPES, TEXT_ANNOTATION_TYPES, INLINE_UTILITY_ANNOTATION_TYPES, FULLSCREEN_UTILITY_ANNOTATION_TYPES, - GALLERY_UTILITY_ANNOTATION_TYPES, + CUE_UTILITY_ANNOTATION_TYPES, CURTAIN_COLOR_LOOKUP, GROWL, } from 'app/constants' @@ -112,14 +112,18 @@ export const loadSections = () => dispatch => { } } - // build timeline of gallery / carousel advance instructions. this is in reverse so we can step thru it + // 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 (GALLERY_UTILITY_ANNOTATION_TYPES.has(annotation.type) && currentSection.fullscreenTimeline.length) { - const lastTimelineEvent = currentSection.fullscreenTimeline[currentSection.fullscreenTimeline.length - 1] - annotation.settings.frame_index = parseInt(annotation.settings.frame_index) - annotation.settings.seek_index = annotation.settings.half_frame ? annotation.settings.frame_index + 0.5 : annotation.settings.frame_index - lastTimelineEvent.timeline.unshift(annotation) - lastTimelineEvent.timelineLookup[annotation.settings.frame_index] = annotation + if (CUE_UTILITY_ANNOTATION_TYPES.has(annotation.type)) { + if (annotation.type === 'gallery_advance') { + annotation.settings.frame_index = parseInt(annotation.settings.frame_index) + annotation.settings.seek_index = annotation.settings.half_frame ? annotation.settings.frame_index + 0.5 : annotation.settings.frame_index + currentSection.mediaCues[annotation.settings.media_id] = currentSection.mediaCues[annotation.settings.media_id] || [] + currentSection.mediaCues[annotation.settings.media_id].push(annotation) + } + else { + currentSection.cues.push(annotation) + } } // build timeline of special inline items @@ -229,6 +233,8 @@ const newSection = (annotation, index, mediaIndex) => ({ cover_style: annotation.settings.cover_style || "cover", media: [], fullscreenTimeline: [], + cues: [], + mediaCues: {}, index, mediaIndex, no_audio: !!annotation.settings.no_audio, |
