Changes lastN event params to leaving and entering endpoint IDs.
Uses leavingIDs to more efficiently iterate over remote videos.
This commit is contained in:
parent
d383230532
commit
e29120a9c1
|
@ -1305,8 +1305,9 @@ export default {
|
|||
});
|
||||
|
||||
room.on(
|
||||
ConferenceEvents.LAST_N_ENDPOINTS_CHANGED, (ids, enteringIds) => {
|
||||
APP.UI.handleLastNEndpoints(ids, enteringIds);
|
||||
ConferenceEvents.LAST_N_ENDPOINTS_CHANGED,
|
||||
(leavingIds, enteringIds) => {
|
||||
APP.UI.handleLastNEndpoints(leavingIds, enteringIds);
|
||||
});
|
||||
|
||||
room.on(
|
||||
|
|
|
@ -837,8 +837,8 @@ UI.markDominantSpeaker = function (id) {
|
|||
VideoLayout.onDominantSpeakerChanged(id);
|
||||
};
|
||||
|
||||
UI.handleLastNEndpoints = function (ids, enteringIds) {
|
||||
VideoLayout.onLastNEndpointsChanged(ids, enteringIds);
|
||||
UI.handleLastNEndpoints = function (leavingIds, enteringIds) {
|
||||
VideoLayout.onLastNEndpointsChanged(leavingIds, enteringIds);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -687,27 +687,34 @@ var VideoLayout = {
|
|||
/**
|
||||
* On last N change event.
|
||||
*
|
||||
* @param lastNEndpoints the list of last N endpoints
|
||||
* @param endpointsLeavingLastN the list currently leaving last N
|
||||
* endpoints
|
||||
* @param endpointsEnteringLastN the list currently entering last N
|
||||
* endpoints
|
||||
*/
|
||||
onLastNEndpointsChanged (lastNEndpoints, endpointsEnteringLastN) {
|
||||
onLastNEndpointsChanged (endpointsLeavingLastN, endpointsEnteringLastN) {
|
||||
if (endpointsLeavingLastN) {
|
||||
endpointsLeavingLastN.forEach(this._updateRemoteVideo, this);
|
||||
}
|
||||
|
||||
Object.keys(remoteVideos).forEach(
|
||||
id => {
|
||||
if (lastNEndpoints.length > 0
|
||||
&& lastNEndpoints.indexOf(id) < 0
|
||||
|| endpointsEnteringLastN.length > 0
|
||||
&& endpointsEnteringLastN.indexOf(id) > 0) {
|
||||
if (endpointsEnteringLastN) {
|
||||
endpointsEnteringLastN.forEach(this._updateRemoteVideo, this);
|
||||
}
|
||||
},
|
||||
|
||||
let remoteVideo = (id) ? remoteVideos[id] : null;
|
||||
if (remoteVideo) {
|
||||
remoteVideo.updateView();
|
||||
if (remoteVideo.isCurrentlyOnLargeVideo())
|
||||
this.updateLargeVideo(id);
|
||||
}
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Updates remote video by id if it exists.
|
||||
* @param {string} id of the remote video
|
||||
* @private
|
||||
*/
|
||||
_updateRemoteVideo(id) {
|
||||
const remoteVideo = remoteVideos[id];
|
||||
if (remoteVideo) {
|
||||
remoteVideo.updateView();
|
||||
if (remoteVideo.isCurrentlyOnLargeVideo()) {
|
||||
this.updateLargeVideo(id);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue