summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/viewer.actions.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-11-18 18:07:29 +0100
committerJules Laplace <julescarbon@gmail.com>2020-11-18 18:07:29 +0100
commit4ad86a73f16c892940dabdfaf0d621644bc2747e (patch)
treea85f70e9a99ea50a3d51a61200eea9d4a82315af /animism-align/frontend/app/views/viewer/viewer.actions.js
parentf0a304ee08c9acbbeb869596b03935b55830a31e (diff)
passing cues down to the video and galleries
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.actions.js24
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,