Files
jitsi-meet/react/features/video-layout/reducer.js
William Liang d3fe246f61 refactor(multi-stream) refactor virtual screenshare creation and support plan-b clients (#11445)
* fix(multi-stream) update selector to find ss track by videoType or mediaType

* ref(multi-stream) move fake ss creation logic and support video type changed

* refactor(multi-stream) decouple sending and receiving multiple screenshare streams

* fix(multi-stream) fix receiver constraints with signaling and without multi-stream

* fix(mutli-stream) ensure plan b original SS thumbnail displays avatar

* fix(multi-stream) show fake SS for plan b sender

* refactor(multi-stream) poc for moving SS creation to state listener

* remove reference to fake SS creation

* fix lint errors

* rename to virtual screenshare participants

* fix minor bugs

* rename participant subscriber to specify web support only
2022-04-29 10:32:16 -04:00

48 lines
1.1 KiB
JavaScript

// @flow
import { ReducerRegistry } from '../base/redux';
import {
SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
SET_TILE_VIEW,
VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED
} from './actionTypes';
const DEFAULT_STATE = {
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
};
const STORE_NAME = 'features/video-layout';
ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => {
switch (action.type) {
case SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED:
case VIRTUAL_SCREENSHARE_REMOTE_PARTICIPANTS_UPDATED: {
return {
...state,
remoteScreenShares: action.participantIds
};
}
case SET_TILE_VIEW:
return {
...state,
tileViewEnabled: action.enabled
};
}
return state;
});