2017-10-13 19:31:05 +00:00
|
|
|
// @flow
|
2017-10-02 23:08:07 +00:00
|
|
|
|
2017-10-13 19:31:05 +00:00
|
|
|
import { getPinnedParticipant } from '../base/participants';
|
2017-08-29 15:08:16 +00:00
|
|
|
|
2017-10-13 19:31:05 +00:00
|
|
|
declare var interfaceConfig: Object;
|
2017-08-29 15:08:16 +00:00
|
|
|
|
|
|
|
/**
|
2017-10-13 19:31:05 +00:00
|
|
|
* Determines whether the remote video thumbnails should be displayed/visible in
|
|
|
|
* the filmstrip.
|
2017-08-29 15:08:16 +00:00
|
|
|
*
|
|
|
|
* @param {Object} state - The full redux state.
|
2017-10-13 19:31:05 +00:00
|
|
|
* @returns {boolean} - If remote video thumbnails should be displayed/visible
|
|
|
|
* in the filmstrip, then {@code true}; otherwise, {@code false}.
|
2017-08-29 15:08:16 +00:00
|
|
|
*/
|
2017-10-02 23:08:07 +00:00
|
|
|
export function shouldRemoteVideosBeVisible(state: Object) {
|
2017-08-29 15:08:16 +00:00
|
|
|
const participants = state['features/base/participants'];
|
2017-10-13 19:31:05 +00:00
|
|
|
const participantCount = participants.length;
|
|
|
|
let pinnedParticipant;
|
2017-08-29 15:08:16 +00:00
|
|
|
|
2017-10-13 19:31:05 +00:00
|
|
|
return Boolean(
|
|
|
|
participantCount > 2
|
2017-08-29 15:08:16 +00:00
|
|
|
|
2017-10-13 19:31:05 +00:00
|
|
|
// Always show the filmstrip when there is another participant to
|
|
|
|
// show and the filmstrip is hovered, or local video is pinned, or
|
|
|
|
// the toolbar is displayed.
|
|
|
|
|| (participantCount > 1
|
|
|
|
&& (state['features/filmstrip'].hovered
|
|
|
|
|| state['features/toolbox'].visible
|
|
|
|
|| ((pinnedParticipant = getPinnedParticipant(participants))
|
|
|
|
&& pinnedParticipant.local)))
|
2017-08-29 15:08:16 +00:00
|
|
|
|
2017-10-13 19:31:05 +00:00
|
|
|
|| (typeof interfaceConfig === 'object'
|
|
|
|
&& interfaceConfig.filmStripOnly)
|
2017-08-29 15:08:16 +00:00
|
|
|
|
2017-10-13 19:31:05 +00:00
|
|
|
|| state['features/base/config'].disable1On1Mode);
|
2017-08-29 15:08:16 +00:00
|
|
|
}
|