From 2a5e169c2f5683f87559096d2ac17795f941b3a3 Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty <54324652+jallamsetty1@users.noreply.github.com> Date: Thu, 21 Jul 2022 11:53:35 -0400 Subject: [PATCH] fix(filmstrip): Remove SS ep from list of active speakers. This fixes a case where duplicate SS tile appears when SS ep is the dominant speaker and all the active speakers are currently visisble. --- react/features/base/participants/functions.js | 6 +++--- react/features/filmstrip/functions.any.js | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/react/features/base/participants/functions.js b/react/features/base/participants/functions.js index 3aabc95b8..79ce9916a 100644 --- a/react/features/base/participants/functions.js +++ b/react/features/base/participants/functions.js @@ -63,12 +63,12 @@ export function getActiveSpeakersToBeDisplayed(stateful: Object | Function) { speakersList } = state['features/base/participants']; const { visibleRemoteParticipants } = state['features/filmstrip']; + const activeSpeakers = new Map(speakersList); // Do not re-sort the active speakers if all of them are currently visible. - if (typeof visibleRemoteParticipants === 'undefined' || speakersList.size <= visibleRemoteParticipants.size) { - return speakersList; + if (typeof visibleRemoteParticipants === 'undefined' || activeSpeakers.size <= visibleRemoteParticipants.size) { + return activeSpeakers; } - const activeSpeakers = new Map(speakersList); let availableSlotsForActiveSpeakers = visibleRemoteParticipants.size; // Remove screenshares from the count. diff --git a/react/features/filmstrip/functions.any.js b/react/features/filmstrip/functions.any.js index d971a0ed8..b96e5d28c 100644 --- a/react/features/filmstrip/functions.any.js +++ b/react/features/filmstrip/functions.any.js @@ -49,10 +49,12 @@ export function updateRemoteParticipants(store: Object, participantId: ?number) remoteParticipants.delete(ownerId); remoteParticipants.delete(screenshare); + speakers.delete(ownerId); } } else { for (const screenshare of screenShares.keys()) { remoteParticipants.delete(screenshare); + speakers.delete(screenshare); } }