Files
jitsi-meet/react/features/video-layout/reducer.js
Jaya Allamsetty 91197bc69f fix(quality-control): Send the new receiver constraints on state changes.
The client now listens for changes to lastN, selectedEndpoints and maxReceiverVideoQuality in redux to trigger sending  bridge message in the new format. This fixes an issue where the stage view <-> tile view changes prompt two receiver constraints messages to be sent, first with the maxHeight update and then with the selected endpoints update.
2021-05-10 16:06:19 -04:00

54 lines
1.2 KiB
JavaScript

// @flow
import { ReducerRegistry } from '../base/redux';
import {
SCREEN_SHARE_REMOTE_PARTICIPANTS_UPDATED,
SELECT_ENDPOINTS,
SET_TILE_VIEW
} 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: {
return {
...state,
remoteScreenShares: action.participantIds
};
}
case SELECT_ENDPOINTS: {
return {
...state,
selectedEndpoints: action.participantIds
};
}
case SET_TILE_VIEW:
return {
...state,
tileViewEnabled: action.enabled
};
}
return state;
});