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 | 29 |
1 files changed, 28 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 167da97..5d10f2a 100644 --- a/animism-align/frontend/app/views/viewer/viewer.actions.js +++ b/animism-align/frontend/app/views/viewer/viewer.actions.js @@ -133,12 +133,39 @@ export const loadSections = () => dispatch => { currentSection.duration = timeline.duration } - // set the end_ts for each section (i.e. just before the next section starts) + let time_to_first_fullscreen_element, initial_curtain_event + // last fixes on the sections for (let i = 0; i < sections.length - 1; i++) { currentSection = sections[i] + // set the end_ts for each section (i.e. just before the next section starts) if (currentSection.end_ts === 0) { currentSection.end_ts = sections[i+1].start_ts - 1 } + // if the first fullscreen event is close to the beginning of the section, move it there + time_to_first_fullscreen_element = 0 + if (currentSection.fullscreenTimeline.length) { + time_to_first_fullscreen_element = Math.abs(currentSection.fullscreenTimeline[0].start_ts - currentSection.start_ts) + if (time_to_first_fullscreen_element < 1.0) { + currentSection.fullscreenTimeline[0].start_ts = currentSection.start_ts + time_to_first_fullscreen_element = 0.0 + } + } + if (!currentSection.fullscreenTimeline.length || time_to_first_fullscreen_element > 0.0) { + // here we should create a dummy curtain event + initial_curtain_event = makeFullscreenEvent(0, { + start_ts: currentSection.start_ts, + type: 'curtain', + settings: { + color: CURTAIN_COLOR_LOOKUP.white, // TODO: get this from the first annotation + fade_in_duration: '0.0', + fade_out_duration: '1.0', + duration: '0', + } + }) + // + console.log(initial_curtain_event) + currentSection.fullscreenTimeline.push(initial_curtain_event) + } currentSection.duration = currentSection.end_ts - currentSection.start_ts } |
