2018-08-08 18:48:23 +00:00
|
|
|
// @flow
|
|
|
|
|
2020-07-23 13:12:25 +00:00
|
|
|
import { ReducerRegistry } from '../base/redux';
|
2018-08-08 18:48:23 +00:00
|
|
|
|
2019-04-11 15:53:34 +00:00
|
|
|
import {
|
2021-01-28 12:36:01 +00:00
|
|
|
SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
|
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 = {
|
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
|
|
|
};
|
|
|
|
|
2018-08-31 15:36:01 +00:00
|
|
|
const STORE_NAME = 'features/video-layout';
|
|
|
|
|
2019-04-11 15:53:34 +00:00
|
|
|
ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
|
2018-08-08 18:48:23 +00:00
|
|
|
switch (action.type) {
|
2022-04-29 14:32:16 +00:00
|
|
|
case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED:
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-08-08 18:48:23 +00:00
|
|
|
case SET_TILE_VIEW:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
tileViewEnabled: action.enabled
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
});
|