Always show screensharing feed as primary

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-07-21 16:20:09 +02:00
parent 51cf426179
commit 2014517173
No known key found for this signature in database
GPG Key ID: 55C211A1226CB17D
1 changed files with 3 additions and 4 deletions

View File

@ -256,10 +256,9 @@ export default class CallView extends React.Component<IProps, IState> {
private getOrderedFeeds(feeds: Array<CallFeed>): { primary: CallFeed, secondary: Array<CallFeed> } {
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());