From 2ba7b3acb732f038cdb9ce0a888a93b02c4c3a1a Mon Sep 17 00:00:00 2001 From: Duduman Bogdan Vlad Date: Fri, 7 Oct 2022 16:06:25 +0100 Subject: [PATCH] fix(large-view) fix selection if local SS auto-select is true --- react/features/large-video/actions.any.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/react/features/large-video/actions.any.js b/react/features/large-video/actions.any.js index 4d7002168..c795a0f16 100644 --- a/react/features/large-video/actions.any.js +++ b/react/features/large-video/actions.any.js @@ -7,6 +7,7 @@ import { MEDIA_TYPE } from '../base/media'; import { getDominantSpeakerParticipant, getLocalParticipant, + getLocalScreenShareParticipant, getPinnedParticipant, getRemoteParticipants, getVirtualScreenshareParticipantByOwnerId @@ -138,7 +139,18 @@ function _electParticipantInLargeVideo(state) { return participant.id; } - if (getAutoPinSetting()) { + const autoPinSetting = getAutoPinSetting(); + + if (autoPinSetting) { + // when the setting auto_pin_latest_screen_share is true as spot does, prioritize local screenshare + if (autoPinSetting === true) { + const localScreenShareParticipant = getLocalScreenShareParticipant(state); + + if (localScreenShareParticipant) { + return localScreenShareParticipant.id; + } + } + // Pick the most recent remote screenshare that was added to the conference. const remoteScreenShares = state['features/video-layout'].remoteScreenShares;