2022-09-01 11:00:49 +00:00
|
|
|
import ReducerRegistry from '../base/redux/ReducerRegistry';
|
2018-08-08 18:48:23 +00:00
|
|
|
|
2019-04-11 15:53:34 +00:00
|
|
|
import {
|
2022-05-06 10:14:10 +00:00
|
|
|
SET_CAR_MODE,
|
2022-04-29 14:32:16 +00:00
|
|
|
SET_TILE_VIEW,
|
|
|
|
VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED
|
2019-04-11 15:53:34 +00:00
|
|
|
} from './actionTypes';
|
|
|
|
|
|
|
|
const DEFAULT_STATE = {
|
2022-05-06 10:14:10 +00:00
|
|
|
/**
|
|
|
|
* Whether we are in carmode.
|
|
|
|
*
|
|
|
|
* @public
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
|
|
|
carMode: false,
|
|
|
|
|
2021-01-28 12:36:01 +00:00
|
|
|
remoteScreenShares: [],
|
2019-04-17 15:05:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The indicator which determines whether the video layout should display
|
|
|
|
* video thumbnails in a tiled layout.
|
|
|
|
*
|
2020-07-23 13:12:25 +00:00
|
|
|
* Note: undefined means that the user hasn't requested anything in particular yet, so
|
|
|
|
* we use our auto switching rules.
|
|
|
|
*
|
2019-04-17 15:05:32 +00:00
|
|
|
* @public
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
2020-07-23 13:12:25 +00:00
|
|
|
tileViewEnabled: undefined
|
2019-04-17 15:05:32 +00:00
|
|
|
};
|
|
|
|
|
2022-09-01 11:00:49 +00:00
|
|
|
export interface IVideoLayoutState {
|
|
|
|
carMode: boolean;
|
|
|
|
remoteScreenShares: string[];
|
|
|
|
tileViewEnabled?: boolean;
|
|
|
|
}
|
|
|
|
|
2018-08-31 15:36:01 +00:00
|
|
|
const STORE_NAME = 'features/video-layout';
|
|
|
|
|
2022-09-05 09:05:07 +00:00
|
|
|
ReducerRegistry.register<IVideoLayoutState>(STORE_NAME, (state = DEFAULT_STATE, action): IVideoLayoutState => {
|
2018-08-08 18:48:23 +00:00
|
|
|
switch (action.type) {
|
2022-05-06 10:14:10 +00:00
|
|
|
case VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED:
|
2019-04-11 15:53:34 +00:00
|
|
|
return {
|
|
|
|
...state,
|
2021-01-28 12:36:01 +00:00
|
|
|
remoteScreenShares: action.participantIds
|
2019-04-11 15:53:34 +00:00
|
|
|
};
|
2022-05-06 10:14:10 +00:00
|
|
|
|
|
|
|
case SET_CAR_MODE:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
carMode: action.enabled
|
|
|
|
};
|
2019-04-11 15:53:34 +00:00
|
|
|
|
2018-08-08 18:48:23 +00:00
|
|
|
case SET_TILE_VIEW:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
tileViewEnabled: action.enabled
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
});
|