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.
This commit is contained in:
Leonard Kim 2018-11-27 12:22:25 -08:00
parent 420c466f80
commit 769a2c7c94
2 changed files with 19 additions and 2 deletions

View File

@ -125,6 +125,20 @@ export function getParticipantCount(stateful: Object | Function) {
return getParticipants(stateful).length; 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. * Returns participant's display name.
* *

View File

@ -1,7 +1,7 @@
// @flow // @flow
import { import {
getParticipantCount, getParticipantCountWithFake,
getPinnedParticipant getPinnedParticipant
} from '../base/participants'; } from '../base/participants';
import { toState } from '../base/redux'; import { toState } from '../base/redux';
@ -36,7 +36,10 @@ export function shouldRemoteVideosBeVisible(state: Object) {
return false; 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; let pinnedParticipant;
return Boolean( return Boolean(