Ver código fonte

ref(video-layout): updates connection status when redux updates

master
Leonard Kim 7 anos atrás
pai
commit
ec0439cbb1
3 arquivos alterados com 15 adições e 14 exclusões
  1. 2
    5
      conference.js
  2. 0
    9
      modules/UI/UI.js
  3. 13
    0
      react/features/video-layout/middleware.web.js

+ 2
- 5
conference.js Ver arquivo

@@ -1798,12 +1798,9 @@ export default {
1798 1798
 
1799 1799
         room.on(
1800 1800
             JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
1801
-            (id, connectionStatus) => {
1802
-                APP.store.dispatch(participantConnectionStatusChanged(
1803
-                    id, connectionStatus));
1801
+            (id, connectionStatus) => APP.store.dispatch(
1802
+                participantConnectionStatusChanged(id, connectionStatus)));
1804 1803
 
1805
-                APP.UI.participantConnectionStatusChanged(id);
1806
-            });
1807 1804
         room.on(
1808 1805
             JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
1809 1806
             id => APP.store.dispatch(dominantSpeakerChanged(id, room)));

+ 0
- 9
modules/UI/UI.js Ver arquivo

@@ -826,15 +826,6 @@ UI.handleLastNEndpoints = function(leavingIds, enteringIds) {
826 826
     VideoLayout.onLastNEndpointsChanged(leavingIds, enteringIds);
827 827
 };
828 828
 
829
-/**
830
- * Will handle notification about participant's connectivity status change.
831
- *
832
- * @param {string} id the id of remote participant(MUC jid)
833
- */
834
-UI.participantConnectionStatusChanged = function(id) {
835
-    VideoLayout.onParticipantConnectionStatusChanged(id);
836
-};
837
-
838 829
 /**
839 830
  * Prompt user for nickname.
840 831
  */

+ 13
- 0
react/features/video-layout/middleware.web.js Ver arquivo

@@ -5,6 +5,7 @@ import UIEvents from '../../../service/UI/UIEvents';
5 5
 
6 6
 import {
7 7
     DOMINANT_SPEAKER_CHANGED,
8
+    PARTICIPANT_UPDATED,
8 9
     PIN_PARTICIPANT
9 10
 } from '../base/participants';
10 11
 import { MiddlewareRegistry } from '../base/redux';
@@ -26,6 +27,18 @@ MiddlewareRegistry.register(store => next => action => {
26 27
     const result = next(action);
27 28
 
28 29
     switch (action.type) {
30
+
31
+    case PARTICIPANT_UPDATED: {
32
+        // Look for actions that triggered a change to connectionStatus. This is
33
+        // done instead of changing the connection status change action to be
34
+        // explicit in order to minimize changes to other code.
35
+        if (typeof action.participant.connectionStatus !== 'undefined') {
36
+            VideoLayout.onParticipantConnectionStatusChanged(
37
+                action.participant.id);
38
+        }
39
+        break;
40
+    }
41
+
29 42
     case DOMINANT_SPEAKER_CHANGED:
30 43
         VideoLayout.onDominantSpeakerChanged(action.participant.id);
31 44
         break;

Carregando…
Cancelar
Salvar