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