浏览代码

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

master
Leonard Kim 7 年前
父节点
当前提交
ec0439cbb1
共有 3 个文件被更改,包括 15 次插入14 次删除
  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 查看文件

1798
 
1798
 
1799
         room.on(
1799
         room.on(
1800
             JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
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
         room.on(
1804
         room.on(
1808
             JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
1805
             JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
1809
             id => APP.store.dispatch(dominantSpeakerChanged(id, room)));
1806
             id => APP.store.dispatch(dominantSpeakerChanged(id, room)));

+ 0
- 9
modules/UI/UI.js 查看文件

826
     VideoLayout.onLastNEndpointsChanged(leavingIds, enteringIds);
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
  * Prompt user for nickname.
830
  * Prompt user for nickname.
840
  */
831
  */

+ 13
- 0
react/features/video-layout/middleware.web.js 查看文件

5
 
5
 
6
 import {
6
 import {
7
     DOMINANT_SPEAKER_CHANGED,
7
     DOMINANT_SPEAKER_CHANGED,
8
+    PARTICIPANT_UPDATED,
8
     PIN_PARTICIPANT
9
     PIN_PARTICIPANT
9
 } from '../base/participants';
10
 } from '../base/participants';
10
 import { MiddlewareRegistry } from '../base/redux';
11
 import { MiddlewareRegistry } from '../base/redux';
26
     const result = next(action);
27
     const result = next(action);
27
 
28
 
28
     switch (action.type) {
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
     case DOMINANT_SPEAKER_CHANGED:
42
     case DOMINANT_SPEAKER_CHANGED:
30
         VideoLayout.onDominantSpeakerChanged(action.participant.id);
43
         VideoLayout.onDominantSpeakerChanged(action.participant.id);
31
         break;
44
         break;

正在加载...
取消
保存