From 201451717349bf11a48c7b96fc5d6ced62407424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 21 Jul 2021 16:20:09 +0200 Subject: [PATCH] Always show screensharing feed as primary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/voip/CallView.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index a9389d224a..e878808c7e 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -256,10 +256,9 @@ export default class CallView extends React.Component { private getOrderedFeeds(feeds: Array): { primary: CallFeed, secondary: Array } { let primary; - // First try to find remote screen-sharing stream - primary = feeds.find((feed) => { - return feed.purpose === SDPStreamMetadataPurpose.Screenshare && !feed.isLocal(); - }); + // Try to use a screensharing as primary, a remote one if possible + const screensharingFeeds = feeds.filter((feed) => feed.purpose === SDPStreamMetadataPurpose.Screenshare); + primary = screensharingFeeds.find((feed) => !feed.isLocal()) || screensharingFeeds[0]; // If we didn't find remote screen-sharing stream, try to find any remote stream if (!primary) { primary = feeds.find((feed) => !feed.isLocal());