From d5a2281a0115229eceeed2bb1d03d54eae668c0d Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Fri, 17 Oct 2014 14:16:37 +0300 Subject: [PATCH] Fixes the issue with ether pad and the broken thumbnail selection. --- videolayout.js | 85 +++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/videolayout.js b/videolayout.js index 7a502bab1..86696f86b 100644 --- a/videolayout.js +++ b/videolayout.js @@ -175,54 +175,53 @@ var VideoLayout = (function (my) { ? getDesktopVideoPosition : getCameraVideoPosition; - if (largeVideoState.isVisible) { - // Only if the large video is currently visible. - // Disable previous dominant speaker video. - if (largeVideoState.oldJid) { - var oldResourceJid = Strophe.getResourceFromJid(largeVideoState.oldJid); - VideoLayout.enableDominantSpeaker(oldResourceJid, false); - if(VideoLayout.connectionIndicators) { - var videoContainerId = null; - if (oldResourceJid == Strophe.getResourceFromJid(connection.emuc.myroomjid)) { - videoContainerId = 'localVideoContainer'; - } - else { - videoContainerId = 'participant_' + oldResourceJid; - } - if(VideoLayout.connectionIndicators[videoContainerId]) - VideoLayout.connectionIndicators[videoContainerId].setShowHQ(false); + + // Only if the large video is currently visible. + // Disable previous dominant speaker video. + if (largeVideoState.oldJid) { + var oldResourceJid = Strophe.getResourceFromJid(largeVideoState.oldJid); + VideoLayout.enableDominantSpeaker(oldResourceJid, false); + if(VideoLayout.connectionIndicators) { + var videoContainerId = null; + if (oldResourceJid == Strophe.getResourceFromJid(connection.emuc.myroomjid)) { + videoContainerId = 'localVideoContainer'; } - - } - - // Enable new dominant speaker in the remote videos section. - if (largeVideoState.userJid) { - var resourceJid = Strophe.getResourceFromJid(largeVideoState.userJid); - VideoLayout.enableDominantSpeaker(resourceJid, true); - if(VideoLayout.connectionIndicators) - { - var videoContainerId = null; - if (resourceJid - === Strophe.getResourceFromJid(connection.emuc.myroomjid)) { - videoContainerId = 'localVideoContainer'; - } - else { - videoContainerId = 'participant_' + resourceJid; - } - if(VideoLayout.connectionIndicators[videoContainerId]) - VideoLayout.connectionIndicators[videoContainerId].setShowHQ(true); + else { + videoContainerId = 'participant_' + oldResourceJid; } - + if(VideoLayout.connectionIndicators[videoContainerId]) + VideoLayout.connectionIndicators[videoContainerId].setShowHQ(false); } - largeVideoState.updateInProgress = false; - - if (fade) { - // using "this" should be ok because we're called - // from within the fadeOut event. - $(this).fadeIn(300); - } } + + // Enable new dominant speaker in the remote videos section. + if (largeVideoState.userJid) { + var resourceJid = Strophe.getResourceFromJid(largeVideoState.userJid); + VideoLayout.enableDominantSpeaker(resourceJid, true); + if(VideoLayout.connectionIndicators) + { + var videoContainerId = null; + if (resourceJid + === Strophe.getResourceFromJid(connection.emuc.myroomjid)) { + videoContainerId = 'localVideoContainer'; + } + else { + videoContainerId = 'participant_' + resourceJid; + } + if(VideoLayout.connectionIndicators[videoContainerId]) + VideoLayout.connectionIndicators[videoContainerId].setShowHQ(true); + } + + } + + if (fade && largeVideoState.isVisible) { + // using "this" should be ok because we're called + // from within the fadeOut event. + $(this).fadeIn(300); + } + + largeVideoState.updateInProgress = false; }; if (fade) {