Browse Source

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 7 years ago
parent
commit
2bd0f77671

+ 1
- 1
conference.js View File

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

+ 0
- 17
modules/UI/UI.js View File

267
     followMeHandler = new FollowMe(APP.conference, UI);
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
  * Handler for toggling filmstrip
271
  * Handler for toggling filmstrip
282
  */
272
  */
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
  * Removed remote stream from UI.
409
  * Removed remote stream from UI.
427
  * @param {JitsiTrack} track stream to remove
410
  * @param {JitsiTrack} track stream to remove

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

15
 import { createLocalTracksA } from './actions';
15
 import { createLocalTracksA } from './actions';
16
 import {
16
 import {
17
     TOGGLE_SCREENSHARING,
17
     TOGGLE_SCREENSHARING,
18
-    TRACK_ADDED,
19
     TRACK_REMOVED,
18
     TRACK_REMOVED,
20
     TRACK_UPDATED
19
     TRACK_UPDATED
21
 } from './actionTypes';
20
 } from './actionTypes';
93
         }
92
         }
94
         break;
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
     case TRACK_REMOVED:
95
     case TRACK_REMOVED:
105
         // TODO Remove this middleware case once all UI interested in tracks
96
         // TODO Remove this middleware case once all UI interested in tracks
106
         // being removed are converted to react and listening for store changes.
97
         // being removed are converted to react and listening for store changes.

+ 13
- 0
react/features/video-layout/middleware.web.js View File

3
 import VideoLayout from '../../../modules/UI/videolayout/VideoLayout.js';
3
 import VideoLayout from '../../../modules/UI/videolayout/VideoLayout.js';
4
 import UIEvents from '../../../service/UI/UIEvents';
4
 import UIEvents from '../../../service/UI/UIEvents';
5
 
5
 
6
+import { CONFERENCE_JOINED } from '../base/conference';
6
 import {
7
 import {
7
     DOMINANT_SPEAKER_CHANGED,
8
     DOMINANT_SPEAKER_CHANGED,
8
     PARTICIPANT_JOINED,
9
     PARTICIPANT_JOINED,
12
     getParticipantById
13
     getParticipantById
13
 } from '../base/participants';
14
 } from '../base/participants';
14
 import { MiddlewareRegistry } from '../base/redux';
15
 import { MiddlewareRegistry } from '../base/redux';
16
+import { TRACK_ADDED } from '../base/tracks';
15
 
17
 
16
 declare var APP: Object;
18
 declare var APP: Object;
17
 
19
 
30
     const result = next(action);
32
     const result = next(action);
31
 
33
 
32
     switch (action.type) {
34
     switch (action.type) {
35
+    case CONFERENCE_JOINED:
36
+        VideoLayout.mucJoined();
37
+        break;
38
+
33
     case PARTICIPANT_JOINED:
39
     case PARTICIPANT_JOINED:
34
         if (!action.participant.local) {
40
         if (!action.participant.local) {
35
             VideoLayout.addRemoteParticipantContainer(
41
             VideoLayout.addRemoteParticipantContainer(
63
             action.participant.id,
69
             action.participant.id,
64
             Boolean(action.participant.id));
70
             Boolean(action.participant.id));
65
         break;
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
     return result;
81
     return result;

Loading…
Cancel
Save