From 2f03a0a7fe9d5c151d19c84bc67ccb0b672aed5a Mon Sep 17 00:00:00 2001 From: paweldomas Date: Mon, 24 Aug 2015 11:37:23 +0200 Subject: [PATCH] Fixes broken last-N --- modules/UI/videolayout/LocalVideo.js | 2 +- modules/UI/videolayout/VideoLayout.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/UI/videolayout/LocalVideo.js b/modules/UI/videolayout/LocalVideo.js index d15fc1384..4fd130420 100644 --- a/modules/UI/videolayout/LocalVideo.js +++ b/modules/UI/videolayout/LocalVideo.js @@ -166,7 +166,7 @@ LocalVideo.prototype.changeVideo = function (stream, isMuted) { event.stopPropagation(); } self.VideoLayout.handleVideoThumbClicked( - false, + true, APP.xmpp.myResource()); } diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index 36f6a940c..d6c2a237b 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -681,13 +681,19 @@ var VideoLayout = (function (my) { lastNEndpoints.indexOf(resourceJid) < 0 && localLastNSet.indexOf(resourceJid) < 0) { console.log("Remove from last N", resourceJid); - remoteVideos[resourceJid].showPeerContainer('hide'); + if (remoteVideos[resourceJid]) + remoteVideos[resourceJid].showPeerContainer('hide'); + else if (APP.xmpp.myResource() !== resourceJid) + console.error("No remote video for: " + resourceJid); isReceived = false; } else if (resourceJid && $('#participant_' + resourceJid).is(':visible') && lastNEndpoints.indexOf(resourceJid) < 0 && localLastNSet.indexOf(resourceJid) >= 0) { - remoteVideos[resourceJid].showPeerContainer('avatar'); + if (remoteVideos[resourceJid]) + remoteVideos[resourceJid].showPeerContainer('avatar'); + else if (APP.xmpp.myResource() !== resourceJid) + console.error("No remote video for: " + resourceJid); isReceived = false; }