2018-08-08 18:48:23 +00:00
|
|
|
// @flow
|
|
|
|
|
2019-05-18 20:40:58 +00:00
|
|
|
import type { Dispatch } from 'redux';
|
|
|
|
|
2019-04-11 15:53:34 +00:00
|
|
|
import {
|
|
|
|
SCREEN_SHARE_PARTICIPANTS_UPDATED,
|
|
|
|
SET_TILE_VIEW
|
|
|
|
} from './actionTypes';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a (redux) action which signals that the list of known participants
|
|
|
|
* with screen shares has changed.
|
|
|
|
*
|
|
|
|
* @param {string} participantIds - The participants which currently have active
|
|
|
|
* screen share streams.
|
|
|
|
* @returns {{
|
|
|
|
* type: SCREEN_SHARE_PARTICIPANTS_UPDATED,
|
|
|
|
* participantId: string
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function setParticipantsWithScreenShare(participantIds: Array<string>) {
|
|
|
|
return {
|
|
|
|
type: SCREEN_SHARE_PARTICIPANTS_UPDATED,
|
|
|
|
participantIds
|
|
|
|
};
|
|
|
|
}
|
2018-08-08 18:48:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a (redux) action which signals to set the UI layout to be tiled view
|
|
|
|
* or not.
|
|
|
|
*
|
|
|
|
* @param {boolean} enabled - Whether or not tile view should be shown.
|
|
|
|
* @returns {{
|
|
|
|
* type: SET_TILE_VIEW,
|
|
|
|
* enabled: boolean
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function setTileView(enabled: boolean) {
|
|
|
|
return {
|
|
|
|
type: SET_TILE_VIEW,
|
|
|
|
enabled
|
|
|
|
};
|
|
|
|
}
|
2019-05-18 20:40:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a (redux) action which signals either to exit tile view if currently
|
|
|
|
* enabled or enter tile view if currently disabled.
|
|
|
|
*
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
export function toggleTileView() {
|
|
|
|
return (dispatch: Dispatch<any>, getState: Function) => {
|
|
|
|
const { tileViewEnabled } = getState()['features/video-layout'];
|
|
|
|
|
|
|
|
dispatch(setTileView(!tileViewEnabled));
|
|
|
|
};
|
|
|
|
}
|