From cc3a8b7b8df56af3bc48d7a585f278101c6f7568 Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Thu, 25 Aug 2022 18:47:36 -0500 Subject: [PATCH] fix(stage-filmstrip): Pinning Pinning participant was not working for stage filmstrip and screen sharing filmstirp layouts --- react/features/filmstrip/middleware.web.js | 6 +++--- react/features/large-video/actions.any.js | 24 +++++----------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/react/features/filmstrip/middleware.web.js b/react/features/filmstrip/middleware.web.js index fde76b9b4..a7c3ee707 100644 --- a/react/features/filmstrip/middleware.web.js +++ b/react/features/filmstrip/middleware.web.js @@ -46,12 +46,12 @@ import { } from './constants'; import { isFilmstripResizable, - isTopPanelEnabled, isStageFilmstripAvailable, updateRemoteParticipants, updateRemoteParticipantsOnLeave, getActiveParticipantsIds, - getPinnedActiveParticipants + getPinnedActiveParticipants, + isStageFilmstripTopPanel } from './functions.web'; import './subscriber'; @@ -278,7 +278,7 @@ MiddlewareRegistry.register(store => next => action => { const pinnedParticipants = getPinnedActiveParticipants(state); const dominant = getDominantSpeakerParticipant(state); - if (isTopPanelEnabled(state)) { + if (isStageFilmstripTopPanel(state, 2)) { const screenshares = state['features/video-layout'].remoteScreenShares; if (screenshares.find(sId => sId === participantId)) { diff --git a/react/features/large-video/actions.any.js b/react/features/large-video/actions.any.js index f530269e8..4724393af 100644 --- a/react/features/large-video/actions.any.js +++ b/react/features/large-video/actions.any.js @@ -107,17 +107,12 @@ function _electLastVisibleRemoteVideo(tracks) { * @returns {(string|undefined)} */ function _electParticipantInLargeVideo(state) { - const stageFilmstrip = isStageFilmstripAvailable(state); - let participant; + // If a participant is pinned, they will be shown in the LargeVideo (regardless of whether they are local or + // remote) when the filmstrip on stage is disabled. + let participant = getPinnedParticipant(state); - if (!stageFilmstrip) { - // If a participant is pinned, they will be shown in the LargeVideo (regardless of whether they are local or - // remote) when the filmstrip on stage is disabled. - participant = getPinnedParticipant(state); - - if (participant) { - return participant.id; - } + if (participant) { + return participant.id; } // Pick the most recent remote screenshare that was added to the conference. @@ -127,15 +122,6 @@ function _electParticipantInLargeVideo(state) { return remoteScreenShares[remoteScreenShares.length - 1]; } - // Next, pick the pinned participant when filmstrip on stage is enabled. - if (stageFilmstrip) { - participant = getPinnedParticipant(state); - - if (participant) { - return participant.id; - } - } - // Next, pick the dominant speaker (other than self). participant = getDominantSpeakerParticipant(state); if (participant && !participant.local) {