Explorar el Código

fix(video-layout): Unpin SS when the screensharing participant leaves.

master
Jaya Allamsetty hace 4 años
padre
commit
c12c554138
Se han modificado 1 ficheros con 8 adiciones y 7 borrados
  1. 8
    7
      react/features/video-layout/subscriber.js

+ 8
- 7
react/features/video-layout/subscriber.js Ver fichero

@@ -97,19 +97,20 @@ function _getAutoPinSetting() {
97 97
 function _updateAutoPinnedParticipant({ dispatch, getState }) {
98 98
     const state = getState();
99 99
     const remoteScreenShares = state['features/video-layout'].remoteScreenShares;
100
+    const pinned = getPinnedParticipant(getState);
101
+
102
+    // Unpin the screenshare when the screensharing participant has left.
103
+    if (!remoteScreenShares?.length) {
104
+        const participantId = pinned ? pinned.id : null;
105
+
106
+        dispatch(pinParticipant(participantId));
100 107
 
101
-    if (!remoteScreenShares) {
102 108
         return;
103 109
     }
104 110
 
105
-    const latestScreenshareParticipantId
106
-        = remoteScreenShares[remoteScreenShares.length - 1];
107
-
108
-    const pinned = getPinnedParticipant(getState);
111
+    const latestScreenshareParticipantId = remoteScreenShares[remoteScreenShares.length - 1];
109 112
 
110 113
     if (latestScreenshareParticipantId) {
111 114
         dispatch(pinParticipant(latestScreenshareParticipantId));
112
-    } else if (pinned) {
113
-        dispatch(pinParticipant(null));
114 115
     }
115 116
 }

Loading…
Cancelar
Guardar