From 123a74b38ba8c878641395b2599bd0485cfe48de Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty <54324652+jallamsetty1@users.noreply.github.com> Date: Thu, 16 Feb 2023 09:29:44 -0500 Subject: [PATCH] fix(video-quality) Add pinned participants to selectedSources. When mulltiple videos are pinned to the stage filmstrip, the expectation is that the bridge will forward all the videos even if they are of lower quality. For this, the video sources need to be added to selectedSources instead of onStageSources. --- react/features/video-quality/subscriber.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/react/features/video-quality/subscriber.ts b/react/features/video-quality/subscriber.ts index c77f30709..be8f98200 100644 --- a/react/features/video-quality/subscriber.ts +++ b/react/features/video-quality/subscriber.ts @@ -463,7 +463,17 @@ function _updateReceiverVideoConstraints({ getState }: IStore) { } if (getCurrentLayout(state) === LAYOUTS.STAGE_FILMSTRIP_VIEW && activeParticipantsSources.length > 0) { - const onStageSources = [ ...activeParticipantsSources ]; + const selectedSources: string[] = []; + const onStageSources: string[] = []; + + // If more than one video source is pinned to the stage filmstrip, they need to be added to the + // 'selectedSources' so that the bridge can allocate bandwidth for all the sources as opposed to doing + // greedy allocation for the sources (which happens when they are added to 'onStageSources'). + if (activeParticipantsSources.length > 1) { + selectedSources.push(...activeParticipantsSources); + } else { + onStageSources.push(activeParticipantsSources[0]); + } activeParticipantsSources.forEach(sourceName => { const isScreenSharing = remoteScreenShares.includes(sourceName); @@ -485,6 +495,7 @@ function _updateReceiverVideoConstraints({ getState }: IStore) { } receiverConstraints.onStageSources = onStageSources; + receiverConstraints.selectedSources = selectedSources; } else if (largeVideoSourceName) { let quality = VIDEO_QUALITY_UNLIMITED;