From f242c8cfdc259390b6ff58a35b5559f4af252f41 Mon Sep 17 00:00:00 2001 From: isymchych Date: Fri, 26 Feb 2016 15:20:36 +0200 Subject: [PATCH 1/2] handle missing remoteVideo when removing video element --- modules/UI/videolayout/VideoLayout.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index b7f20e1e2..04653aa3b 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -271,7 +271,10 @@ var VideoLayout = { onRemoteStreamRemoved (stream) { let id = stream.getParticipantId(); - remoteVideos[id].removeRemoteStreamElement(stream); + let remoteVideo = remoteVideos[id]; + if (remoteVideo) { // remote stream may be removed after participant left the conference + remoteVideo.removeRemoteStreamElement(stream); + } }, /** From cd71b0a603df9da6a2265517950dda461b5fb0cf Mon Sep 17 00:00:00 2001 From: isymchych Date: Fri, 26 Feb 2016 15:22:04 +0200 Subject: [PATCH 2/2] use latest version of the config.channelLastN --- modules/UI/videolayout/VideoLayout.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index 04653aa3b..ec88823d0 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -20,7 +20,6 @@ var remoteVideoTypes = {}; var localVideoThumbnail = null; var currentDominantSpeaker = null; -var lastNCount = config.channelLastN; var localLastNCount = config.channelLastN; var localLastNSet = []; var lastNEndpointsCache = []; @@ -98,6 +97,7 @@ var VideoLayout = { localVideoThumbnail = new LocalVideo(VideoLayout, emitter); emitter.addListener(UIEvents.CONTACT_CLICKED, onContactClicked); + this.lastNCount = config.channelLastN; }, initLargeVideo (isSideBarVisible) { @@ -116,9 +116,9 @@ var VideoLayout = { }, isInLastN (resource) { - return lastNCount < 0 || // lastN is disabled + return this.lastNCount < 0 || // lastN is disabled // lastNEndpoints cache not built yet - (lastNCount > 0 && !lastNEndpointsCache.length) || + (this.lastNCount > 0 && !lastNEndpointsCache.length) || (lastNEndpointsCache && lastNEndpointsCache.indexOf(resource) !== -1); }, @@ -578,8 +578,8 @@ var VideoLayout = { * endpoints */ onLastNEndpointsChanged (lastNEndpoints, endpointsEnteringLastN) { - if (lastNCount !== lastNEndpoints.length) - lastNCount = lastNEndpoints.length; + if (this.lastNCount !== lastNEndpoints.length) + this.lastNCount = lastNEndpoints.length; lastNEndpointsCache = lastNEndpoints; @@ -594,8 +594,8 @@ var VideoLayout = { // enters E's local LastN ejecting C. // Increase the local LastN set size, if necessary. - if (lastNCount > localLastNCount) { - localLastNCount = lastNCount; + if (this.lastNCount > localLastNCount) { + localLastNCount = this.lastNCount; } // Update the local LastN set preserving the order in which the