snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
63
react/features/video-layout/reducer.ts
Normal file
63
react/features/video-layout/reducer.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import ReducerRegistry from '../base/redux/ReducerRegistry';
|
||||
|
||||
import {
|
||||
SET_CAR_MODE,
|
||||
SET_TILE_VIEW,
|
||||
VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED
|
||||
} from './actionTypes';
|
||||
|
||||
const DEFAULT_STATE = {
|
||||
/**
|
||||
* Whether we are in carmode.
|
||||
*
|
||||
* @public
|
||||
* @type {boolean}
|
||||
*/
|
||||
carMode: false,
|
||||
|
||||
remoteScreenShares: [],
|
||||
|
||||
/**
|
||||
* The indicator which determines whether the video layout should display
|
||||
* video thumbnails in a tiled layout.
|
||||
*
|
||||
* Note: undefined means that the user hasn't requested anything in particular yet, so
|
||||
* we use our auto switching rules.
|
||||
*
|
||||
* @public
|
||||
* @type {boolean}
|
||||
*/
|
||||
tileViewEnabled: undefined
|
||||
};
|
||||
|
||||
export interface IVideoLayoutState {
|
||||
carMode: boolean;
|
||||
remoteScreenShares: string[];
|
||||
tileViewEnabled?: boolean;
|
||||
}
|
||||
|
||||
const STORE_NAME = 'features/video-layout';
|
||||
|
||||
ReducerRegistry.register<IVideoLayoutState>(STORE_NAME, (state = DEFAULT_STATE, action): IVideoLayoutState => {
|
||||
switch (action.type) {
|
||||
case VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED:
|
||||
return {
|
||||
...state,
|
||||
remoteScreenShares: action.participantIds
|
||||
};
|
||||
|
||||
case SET_CAR_MODE:
|
||||
return {
|
||||
...state,
|
||||
carMode: action.enabled
|
||||
};
|
||||
|
||||
case SET_TILE_VIEW:
|
||||
return {
|
||||
...state,
|
||||
tileViewEnabled: action.enabled
|
||||
};
|
||||
}
|
||||
|
||||
return state;
|
||||
});
|
||||
Reference in New Issue
Block a user