Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(lastN): select screenshare endpoint always when auto pinning. When trying to auto pin screenshare, always select the endpoint even though it happens to be the large video participant in redux. The auto pin screenshare logic kicks in after the track is added. If the screenshare endpoint is not among the forwarded endpoints from the bridge, it needs to be selected again.

Jaya Allamsettyd6ab0a72a1aa
diff --git a/react/features/large-video/actions.any.js b/react/features/large-video/actions.any.js
index f003f55473..ce17d5dc45 100644
--- a/react/features/large-video/actions.any.js
+++ b/react/features/large-video/actions.any.js
@@ -61,8 +61,20 @@ export function selectParticipantInLargeVideo(participant: ?string) {
const state = getState();
const participantId = participant ?? _electParticipantInLargeVideo(state);
const largeVideo = state['features/large-video'];
+ const screenShares = state['features/video-layout'].screenShares;
+ let latestScreenshareParticipantId;
- if (participantId !== largeVideo.participantId) {
+ if (screenShares && screenShares.length) {
+ latestScreenshareParticipantId = screenShares[screenShares.length - 1];
+ }
+
+ // When trying to auto pin screenshare, always select the endpoint even though it happens to be
+ // the large video participant in redux (for the reasons listed above in the large video selection
+ // logic above). The auto pin screenshare logic kicks in after the track is added
+ // (which updates the large video participant and selects all endpoints because of the auto tile
+ // view mode). If the screenshare endpoint is not among the forwarded endpoints from the bridge,
+ // it needs to be selected again at this point.
+ if (participantId !== largeVideo.participantId || participantId === latestScreenshareParticipantId) {
dispatch({
type: SELECT_LARGE_VIDEO_PARTICIPANT,
participantId