Sfoglia il codice sorgente

ref(large-video): move layout update on stream removal to layout middleware

j8
Leonard Kim 6 anni fa
parent
commit
c7954c284d

+ 0
- 6
modules/UI/UI.js Vedi File

@@ -258,12 +258,6 @@ UI.addLocalStream = track => {
258 258
     }
259 259
 };
260 260
 
261
-/**
262
- * Removed remote stream from UI.
263
- * @param {JitsiTrack} track stream to remove
264
- */
265
-UI.removeRemoteStream = track => VideoLayout.onRemoteStreamRemoved(track);
266
-
267 261
 /**
268 262
  * Setup and show Etherpad.
269 263
  * @param {string} name etherpad id

+ 0
- 9
react/features/base/tracks/middleware.js Vedi File

@@ -15,7 +15,6 @@ import UIEvents from '../../../../service/UI/UIEvents';
15 15
 import { createLocalTracksA } from './actions';
16 16
 import {
17 17
     TOGGLE_SCREENSHARING,
18
-    TRACK_REMOVED,
19 18
     TRACK_UPDATED
20 19
 } from './actionTypes';
21 20
 import { getLocalTrack, setTrackMuted } from './functions';
@@ -92,14 +91,6 @@ MiddlewareRegistry.register(store => next => action => {
92 91
         }
93 92
         break;
94 93
 
95
-    case TRACK_REMOVED:
96
-        // TODO Remove this middleware case once all UI interested in tracks
97
-        // being removed are converted to react and listening for store changes.
98
-        if (typeof APP !== 'undefined' && !action.track.local) {
99
-            APP.UI.removeRemoteStream(action.track.jitsiTrack);
100
-        }
101
-        break;
102
-
103 94
     case TRACK_UPDATED:
104 95
         // TODO Remove the following calls to APP.UI once components interested
105 96
         // in track mute changes are moved into React and/or redux.

+ 7
- 1
react/features/video-layout/middleware.web.js Vedi File

@@ -12,7 +12,7 @@ import {
12 12
     getParticipantById
13 13
 } from '../base/participants';
14 14
 import { MiddlewareRegistry } from '../base/redux';
15
-import { TRACK_ADDED } from '../base/tracks';
15
+import { TRACK_ADDED, TRACK_REMOVED } from '../base/tracks';
16 16
 import { SET_FILMSTRIP_VISIBLE } from '../filmstrip';
17 17
 
18 18
 import './middleware.any';
@@ -83,6 +83,12 @@ MiddlewareRegistry.register(store => next => action => {
83 83
             VideoLayout.onRemoteStreamAdded(action.track.jitsiTrack);
84 84
         }
85 85
 
86
+        break;
87
+    case TRACK_REMOVED:
88
+        if (!action.track.local) {
89
+            VideoLayout.onRemoteStreamRemoved(action.track.jitsiTrack);
90
+        }
91
+
86 92
         break;
87 93
     }
88 94
 

Loading…
Annulla
Salva