diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-06-30 20:11:14 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-06-30 20:11:14 +0200 |
| commit | 250527589e003420a84f36c4191d2e574f1ad28c (patch) | |
| tree | c8ae5ae829c8de1427c2cbb83178cb6c85f71eb7 /animism-align/frontend/views/audio/audio.reducer.js | |
| parent | 7bc1723499503800cbdd446b27e202898fc32b9e (diff) | |
seeking and zooming the waveform. playing the audio
Diffstat (limited to 'animism-align/frontend/views/audio/audio.reducer.js')
| -rw-r--r-- | animism-align/frontend/views/audio/audio.reducer.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/animism-align/frontend/views/audio/audio.reducer.js b/animism-align/frontend/views/audio/audio.reducer.js new file mode 100644 index 0000000..e37933d --- /dev/null +++ b/animism-align/frontend/views/audio/audio.reducer.js @@ -0,0 +1,30 @@ +import * as types from '../../types' +import { session, getDefault, getDefaultInt } from '../../session' + +const initialState = { + playing: false, + play_ts: 0, +} + +export default function alignReducer(state = initialState, action) { + // console.log(action.type, action) + switch (action.type) { + case types.audio.play: + return { + ...state, + playing: true, + } + case types.audio.pause: + return { + ...state, + playing: false, + } + case types.audio.update_time: + return { + ...state, + play_ts: action.play_ts, + } + default: + return state + } +} |
