jiti-meet/react/features/filmstrip/functions.native.js

29 lines
822 B
JavaScript
Raw Normal View History

2018-06-14 09:14:32 +00:00
// @flow
import { getFeatureFlag, FILMSTRIP_ENABLED } from '../base/flags';
2018-06-14 09:14:32 +00:00
import { toState } from '../base/redux';
/**
* Returns true if the filmstrip on mobile is visible, false otherwise.
*
* NOTE: Filmstrip on mobile behaves differently to web, and is only visible
* when there are at least 2 participants.
*
* @param {Object | Function} stateful - The Object or Function that can be
* resolved to a Redux state object with the toState function.
* @returns {boolean}
*/
export function isFilmstripVisible(stateful: Object | Function) {
const state = toState(stateful);
const enabled = getFeatureFlag(state, FILMSTRIP_ENABLED, true);
if (!enabled) {
return false;
}
2018-06-14 09:14:32 +00:00
const { length: participantCount } = state['features/base/participants'];
return participantCount > 1;
2018-06-14 09:14:32 +00:00
}