From 475638e617c5053aeb897d26bfba4c8d1975c614 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 7 Aug 2020 22:59:03 +0200 Subject: next button --- .../frontend/app/views/viewer/viewer.actions.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js') diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js index 8c03a10..01f4232 100644 --- a/animism-align/frontend/app/views/viewer/viewer.actions.js +++ b/animism-align/frontend/app/views/viewer/viewer.actions.js @@ -1,5 +1,6 @@ import * as types from 'app/types' import { store, history, dispatch } from 'app/store' +import actions from 'app/actions' import { MEDIA_ANNOTATION_TYPES, MEDIA_LABEL_TYPES, TEXT_ANNOTATION_TYPES, @@ -150,8 +151,8 @@ const makeFullscreenEvent = (index, annotation) => { return event } -export const setCurrentSection = section => dispatch => { - dispatch({ type: types.viewer.set_current_section, section }) +export const setCurrentSection = (currentSection, nextSection) => dispatch => { + dispatch({ type: types.viewer.set_current_section, currentSection, nextSection }) } export const setNavStyle = color => dispatch => { @@ -169,3 +170,16 @@ export const hideComponent = key => dispatch => { export const toggleComponent = key => dispatch => { dispatch({ type: types.viewer.toggle_component, key, value: !store.getState().viewer[key] }) } + +export const seekToSection = section => dispatch => { + actions.audio.seek(section.start_ts) + actions.audio.play() + actions.viewer.hideComponent('nav') +} + +export const seekToMediaItem = mediaItem => dispatch => { + actions.audio.seek(mediaItem.start_ts) + actions.audio.play() + actions.viewer.hideComponent('nav') + actions.viewer.hideComponent('checklist') +} -- cgit v1.2.3-70-g09d2