From 769a2c7c9403de8cc032fae55a2645289718bc1a Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Tue, 27 Nov 2018 12:22:25 -0800 Subject: [PATCH] fix(filmstrip): show thumbnails in 1-on-1 with a fake participant Filmstrip remote thumbnails display under certain conditions, as defined in filmstrip/functions.web.js. Previously the raw participant count was used, which included fake participants. Using the selector getParticipantCount excludes fake participants, causing YouTube thumbnails to remain hidden in a 1-on-1 call. --- react/features/base/participants/functions.js | 14 ++++++++++++++ react/features/filmstrip/functions.web.js | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/react/features/base/participants/functions.js b/react/features/base/participants/functions.js index b33880bf5..a02166531 100644 --- a/react/features/base/participants/functions.js +++ b/react/features/base/participants/functions.js @@ -125,6 +125,20 @@ export function getParticipantCount(stateful: Object | Function) { return getParticipants(stateful).length; } +/** + * Returns a count of the known participants in the passed in redux state, + * including fake participants. + * + * @param {(Function|Object|Participant[])} stateful - The redux state + * features/base/participants, the (whole) redux state, or redux's + * {@code getState} function to be used to retrieve the state + * features/base/participants. + * @returns {number} + */ +export function getParticipantCountWithFake(stateful: Object | Function) { + return _getAllParticipants(stateful).length; +} + /** * Returns participant's display name. * diff --git a/react/features/filmstrip/functions.web.js b/react/features/filmstrip/functions.web.js index 7bd454589..622315bc0 100644 --- a/react/features/filmstrip/functions.web.js +++ b/react/features/filmstrip/functions.web.js @@ -1,7 +1,7 @@ // @flow import { - getParticipantCount, + getParticipantCountWithFake, getPinnedParticipant } from '../base/participants'; import { toState } from '../base/redux'; @@ -36,7 +36,10 @@ export function shouldRemoteVideosBeVisible(state: Object) { return false; } - const participantCount = getParticipantCount(state); + // Include fake participants to derive how many thumbnails are dispalyed, + // as it is assumed all participants, including fake, will be displayed + // in the filmstrip. + const participantCount = getParticipantCountWithFake(state); let pinnedParticipant; return Boolean(