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

This commit is contained in:
Leonard Kim
2019-05-28 13:28:33 -07:00
committed by virtuacoplenny
parent 251da1861a
commit c7954c284d
3 changed files with 7 additions and 16 deletions

View File

@@ -258,12 +258,6 @@ UI.addLocalStream = track => {
}
};
/**
* Removed remote stream from UI.
* @param {JitsiTrack} track stream to remove
*/
UI.removeRemoteStream = track => VideoLayout.onRemoteStreamRemoved(track);
/**
* Setup and show Etherpad.
* @param {string} name etherpad id

View File

@@ -15,7 +15,6 @@ import UIEvents from '../../../../service/UI/UIEvents';
import { createLocalTracksA } from './actions';
import {
TOGGLE_SCREENSHARING,
TRACK_REMOVED,
TRACK_UPDATED
} from './actionTypes';
import { getLocalTrack, setTrackMuted } from './functions';
@@ -92,14 +91,6 @@ MiddlewareRegistry.register(store => next => action => {
}
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.
if (typeof APP !== 'undefined' && !action.track.local) {
APP.UI.removeRemoteStream(action.track.jitsiTrack);
}
break;
case TRACK_UPDATED:
// TODO Remove the following calls to APP.UI once components interested
// in track mute changes are moved into React and/or redux.

View File

@@ -12,7 +12,7 @@ import {
getParticipantById
} from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
import { TRACK_ADDED } from '../base/tracks';
import { TRACK_ADDED, TRACK_REMOVED } from '../base/tracks';
import { SET_FILMSTRIP_VISIBLE } from '../filmstrip';
import './middleware.any';
@@ -83,6 +83,12 @@ MiddlewareRegistry.register(store => next => action => {
VideoLayout.onRemoteStreamAdded(action.track.jitsiTrack);
}
break;
case TRACK_REMOVED:
if (!action.track.local) {
VideoLayout.onRemoteStreamRemoved(action.track.jitsiTrack);
}
break;
}