Przeglądaj źródła

Move a couple calls to update VideoLayout into the redux update flow (#3173)

* ref(video-layout): move middleware for TRACK_ADDED

* ref(video-layout): call mucJoined when redux knowns of conference join
master
virtuacoplenny 6 lat temu
rodzic
commit
2bd0f77671

+ 1
- 1
conference.js Wyświetl plik

@@ -2301,10 +2301,10 @@ export default {
2301 2301
 
2302 2302
         APP.store.dispatch(conferenceJoined(room));
2303 2303
 
2304
-        APP.UI.mucJoined();
2305 2304
         const displayName
2306 2305
             = APP.store.getState()['features/base/settings'].displayName;
2307 2306
 
2307
+        APP.UI.changeDisplayName('localVideoContainer', displayName);
2308 2308
         APP.API.notifyConferenceJoined(
2309 2309
             this.roomName,
2310 2310
             this._room.myUserId(),

+ 0
- 17
modules/UI/UI.js Wyświetl plik

@@ -267,16 +267,6 @@ UI.initConference = function() {
267 267
     followMeHandler = new FollowMe(APP.conference, UI);
268 268
 };
269 269
 
270
-UI.mucJoined = function() {
271
-    VideoLayout.mucJoined();
272
-
273
-    // Update local video now that a conference is joined a user ID should be
274
-    // set.
275
-    UI.changeDisplayName(
276
-        'localVideoContainer',
277
-        APP.conference.getLocalDisplayName());
278
-};
279
-
280 270
 /** *
281 271
  * Handler for toggling filmstrip
282 272
  */
@@ -415,13 +405,6 @@ UI.addLocalStream = track => {
415 405
     }
416 406
 };
417 407
 
418
-
419
-/**
420
- * Show remote stream on UI.
421
- * @param {JitsiTrack} track stream to show
422
- */
423
-UI.addRemoteStream = track => VideoLayout.onRemoteStreamAdded(track);
424
-
425 408
 /**
426 409
  * Removed remote stream from UI.
427 410
  * @param {JitsiTrack} track stream to remove

+ 0
- 9
react/features/base/tracks/middleware.js Wyświetl plik

@@ -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_ADDED,
19 18
     TRACK_REMOVED,
20 19
     TRACK_UPDATED
21 20
 } from './actionTypes';
@@ -93,14 +92,6 @@ MiddlewareRegistry.register(store => next => action => {
93 92
         }
94 93
         break;
95 94
 
96
-    case TRACK_ADDED:
97
-        // TODO Remove this middleware case once all UI interested in new tracks
98
-        // being added are converted to react and listening for store changes.
99
-        if (typeof APP !== 'undefined' && !action.track.local) {
100
-            APP.UI.addRemoteStream(action.track.jitsiTrack);
101
-        }
102
-        break;
103
-
104 95
     case TRACK_REMOVED:
105 96
         // TODO Remove this middleware case once all UI interested in tracks
106 97
         // being removed are converted to react and listening for store changes.

+ 13
- 0
react/features/video-layout/middleware.web.js Wyświetl plik

@@ -3,6 +3,7 @@
3 3
 import VideoLayout from '../../../modules/UI/videolayout/VideoLayout.js';
4 4
 import UIEvents from '../../../service/UI/UIEvents';
5 5
 
6
+import { CONFERENCE_JOINED } from '../base/conference';
6 7
 import {
7 8
     DOMINANT_SPEAKER_CHANGED,
8 9
     PARTICIPANT_JOINED,
@@ -12,6 +13,7 @@ import {
12 13
     getParticipantById
13 14
 } from '../base/participants';
14 15
 import { MiddlewareRegistry } from '../base/redux';
16
+import { TRACK_ADDED } from '../base/tracks';
15 17
 
16 18
 declare var APP: Object;
17 19
 
@@ -30,6 +32,10 @@ MiddlewareRegistry.register(store => next => action => {
30 32
     const result = next(action);
31 33
 
32 34
     switch (action.type) {
35
+    case CONFERENCE_JOINED:
36
+        VideoLayout.mucJoined();
37
+        break;
38
+
33 39
     case PARTICIPANT_JOINED:
34 40
         if (!action.participant.local) {
35 41
             VideoLayout.addRemoteParticipantContainer(
@@ -63,6 +69,13 @@ MiddlewareRegistry.register(store => next => action => {
63 69
             action.participant.id,
64 70
             Boolean(action.participant.id));
65 71
         break;
72
+
73
+    case TRACK_ADDED:
74
+        if (!action.track.local) {
75
+            VideoLayout.onRemoteStreamAdded(action.track.jitsiTrack);
76
+        }
77
+
78
+        break;
66 79
     }
67 80
 
68 81
     return result;

Ładowanie…
Anuluj
Zapisz