|
@@ -61,8 +61,20 @@ export function selectParticipantInLargeVideo(participant: ?string) {
|
61
|
61
|
const state = getState();
|
62
|
62
|
const participantId = participant ?? _electParticipantInLargeVideo(state);
|
63
|
63
|
const largeVideo = state['features/large-video'];
|
|
64
|
+ const screenShares = state['features/video-layout'].screenShares;
|
|
65
|
+ let latestScreenshareParticipantId;
|
64
|
66
|
|
65
|
|
- if (participantId !== largeVideo.participantId) {
|
|
67
|
+ if (screenShares && screenShares.length) {
|
|
68
|
+ latestScreenshareParticipantId = screenShares[screenShares.length - 1];
|
|
69
|
+ }
|
|
70
|
+
|
|
71
|
+ // When trying to auto pin screenshare, always select the endpoint even though it happens to be
|
|
72
|
+ // the large video participant in redux (for the reasons listed above in the large video selection
|
|
73
|
+ // logic above). The auto pin screenshare logic kicks in after the track is added
|
|
74
|
+ // (which updates the large video participant and selects all endpoints because of the auto tile
|
|
75
|
+ // view mode). If the screenshare endpoint is not among the forwarded endpoints from the bridge,
|
|
76
|
+ // it needs to be selected again at this point.
|
|
77
|
+ if (participantId !== largeVideo.participantId || participantId === latestScreenshareParticipantId) {
|
66
|
78
|
dispatch({
|
67
|
79
|
type: SELECT_LARGE_VIDEO_PARTICIPANT,
|
68
|
80
|
participantId
|