From 8d68239931e2b776b96e30a467c5bd132aa89a4f Mon Sep 17 00:00:00 2001 From: yanas Date: Fri, 13 Jun 2014 19:29:56 +0300 Subject: [PATCH] Fixes disappearing video during active speaker change. --- videolayout.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/videolayout.js b/videolayout.js index 5024acfe9..b9defb225 100644 --- a/videolayout.js +++ b/videolayout.js @@ -532,10 +532,14 @@ var VideoLayout = (function (my) { // If there's an active speaker (automatically) selected we have to // disable this state and update the current active speaker. if (isEnable) { - if (currentActiveSpeaker) - VideoLayout.enableActiveSpeaker(currentActiveSpeaker, false); - else - currentActiveSpeaker = resourceJid; + if (currentActiveSpeaker) { + var oldSpeaker = currentActiveSpeaker; + setTimeout(function () { + VideoLayout.enableActiveSpeaker(oldSpeaker, false); + }, 200); + } + + currentActiveSpeaker = resourceJid; } else if (resourceJid === currentActiveSpeaker) currentActiveSpeaker = null; @@ -565,7 +569,7 @@ var VideoLayout = (function (my) { } else { activeSpeakerCanvas = activeSpeakerCanvas.get(0); - } + } if (videoElement && videoElement.length > 0) { var video = document.getElementById(videoElement.get(0).id);