Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

virtuacoplenny2bd0f7767145
diff --git a/conference.js b/conference.js
index eadb0cbcad..9a6afa8b97 100644
--- a/conference.js
+++ b/conference.js
@@ -2301,10 +2301,10 @@ export default {
APP.store.dispatch(conferenceJoined(room));
- APP.UI.mucJoined();
const displayName
= APP.store.getState()['features/base/settings'].displayName;
+ APP.UI.changeDisplayName('localVideoContainer', displayName);
APP.API.notifyConferenceJoined(
this.roomName,
this._room.myUserId(),
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 140ff854a1..c4351d6a49 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -267,16 +267,6 @@ UI.initConference = function() {
followMeHandler = new FollowMe(APP.conference, UI);
};
-UI.mucJoined = function() {
- VideoLayout.mucJoined();
-
- // Update local video now that a conference is joined a user ID should be
- // set.
- UI.changeDisplayName(
- 'localVideoContainer',
- APP.conference.getLocalDisplayName());
-};
-
/** *
* Handler for toggling filmstrip
*/
@@ -415,13 +405,6 @@ UI.addLocalStream = track => {
}
};
-
-/**
- * Show remote stream on UI.
- * @param {JitsiTrack} track stream to show
- */
-UI.addRemoteStream = track => VideoLayout.onRemoteStreamAdded(track);
-
/**
* Removed remote stream from UI.
* @param {JitsiTrack} track stream to remove
diff --git a/react/features/base/tracks/middleware.js b/react/features/base/tracks/middleware.js
index d5d5031572..e88b480993 100644
--- a/react/features/base/tracks/middleware.js
+++ b/react/features/base/tracks/middleware.js
@@ -15,7 +15,6 @@ import UIEvents from '../../../../service/UI/UIEvents';
import { createLocalTracksA } from './actions';
import {
TOGGLE_SCREENSHARING,
- TRACK_ADDED,
TRACK_REMOVED,
TRACK_UPDATED
} from './actionTypes';
@@ -93,14 +92,6 @@ MiddlewareRegistry.register(store => next => action => {
}
break;
- case TRACK_ADDED:
- // TODO Remove this middleware case once all UI interested in new tracks
- // being added are converted to react and listening for store changes.
- if (typeof APP !== 'undefined' && !action.track.local) {
- APP.UI.addRemoteStream(action.track.jitsiTrack);
- }
- break;
-
case TRACK_REMOVED:
// TODO Remove this middleware case once all UI interested in tracks
// being removed are converted to react and listening for store changes.
diff --git a/react/features/video-layout/middleware.web.js b/react/features/video-layout/middleware.web.js
index 9fdbb95760..9ae4b453d0 100644
--- a/react/features/video-layout/middleware.web.js
+++ b/react/features/video-layout/middleware.web.js
@@ -3,6 +3,7 @@
import VideoLayout from '../../../modules/UI/videolayout/VideoLayout.js';
import UIEvents from '../../../service/UI/UIEvents';
+import { CONFERENCE_JOINED } from '../base/conference';
import {
DOMINANT_SPEAKER_CHANGED,
PARTICIPANT_JOINED,
@@ -12,6 +13,7 @@ import {
getParticipantById
} from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
+import { TRACK_ADDED } from '../base/tracks';
declare var APP: Object;
@@ -30,6 +32,10 @@ MiddlewareRegistry.register(store => next => action => {
const result = next(action);
switch (action.type) {
+ case CONFERENCE_JOINED:
+ VideoLayout.mucJoined();
+ break;
+
case PARTICIPANT_JOINED:
if (!action.participant.local) {
VideoLayout.addRemoteParticipantContainer(
@@ -63,6 +69,13 @@ MiddlewareRegistry.register(store => next => action => {
action.participant.id,
Boolean(action.participant.id));
break;
+
+ case TRACK_ADDED:
+ if (!action.track.local) {
+ VideoLayout.onRemoteStreamAdded(action.track.jitsiTrack);
+ }
+
+ break;
}
return result;