fix(video-layout): Unpin SS when the screensharing participant leaves.
This commit is contained in:
parent
289ba6f764
commit
c12c554138
|
@ -97,19 +97,20 @@ function _getAutoPinSetting() {
|
||||||
function _updateAutoPinnedParticipant({ dispatch, getState }) {
|
function _updateAutoPinnedParticipant({ dispatch, getState }) {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const remoteScreenShares = state['features/video-layout'].remoteScreenShares;
|
const remoteScreenShares = state['features/video-layout'].remoteScreenShares;
|
||||||
|
const pinned = getPinnedParticipant(getState);
|
||||||
|
|
||||||
|
// Unpin the screenshare when the screensharing participant has left.
|
||||||
|
if (!remoteScreenShares?.length) {
|
||||||
|
const participantId = pinned ? pinned.id : null;
|
||||||
|
|
||||||
|
dispatch(pinParticipant(participantId));
|
||||||
|
|
||||||
if (!remoteScreenShares) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const latestScreenshareParticipantId
|
const latestScreenshareParticipantId = remoteScreenShares[remoteScreenShares.length - 1];
|
||||||
= remoteScreenShares[remoteScreenShares.length - 1];
|
|
||||||
|
|
||||||
const pinned = getPinnedParticipant(getState);
|
|
||||||
|
|
||||||
if (latestScreenshareParticipantId) {
|
if (latestScreenshareParticipantId) {
|
||||||
dispatch(pinParticipant(latestScreenshareParticipantId));
|
dispatch(pinParticipant(latestScreenshareParticipantId));
|
||||||
} else if (pinned) {
|
|
||||||
dispatch(pinParticipant(null));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue