2021-03-03 14:37:38 +00:00
|
|
|
// @flow
|
|
|
|
|
2018-03-07 00:28:19 +00:00
|
|
|
import { ReducerRegistry } from '../base/redux';
|
|
|
|
|
2021-04-16 09:43:34 +00:00
|
|
|
import { RESET_SHARED_VIDEO_STATUS, SET_SHARED_VIDEO_STATUS } from './actionTypes';
|
|
|
|
|
|
|
|
const initialState = {};
|
2018-03-07 00:28:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Reduces the Redux actions of the feature features/shared-video.
|
|
|
|
*/
|
2021-04-16 09:43:34 +00:00
|
|
|
ReducerRegistry.register('features/shared-video', (state = initialState, action) => {
|
|
|
|
const { videoUrl, status, time, ownerId, muted, volume } = action;
|
2021-03-03 14:37:38 +00:00
|
|
|
|
2018-03-07 00:28:19 +00:00
|
|
|
switch (action.type) {
|
2021-04-16 09:43:34 +00:00
|
|
|
case RESET_SHARED_VIDEO_STATUS:
|
|
|
|
return initialState;
|
2018-03-07 00:28:19 +00:00
|
|
|
case SET_SHARED_VIDEO_STATUS:
|
|
|
|
return {
|
|
|
|
...state,
|
2021-04-16 09:43:34 +00:00
|
|
|
muted,
|
|
|
|
ownerId,
|
2021-03-03 14:37:38 +00:00
|
|
|
status,
|
|
|
|
time,
|
2021-04-16 09:43:34 +00:00
|
|
|
videoUrl,
|
|
|
|
volume
|
2018-03-07 00:28:19 +00:00
|
|
|
};
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
});
|