Browse Source

Fixes disappearing video during active speaker change.

master
yanas 11 years ago
parent
commit
8d68239931
1 changed files with 9 additions and 5 deletions
  1. 9
    5
      videolayout.js

+ 9
- 5
videolayout.js View File

@@ -532,10 +532,14 @@ var VideoLayout = (function (my) {
532 532
         // If there's an active speaker (automatically) selected we have to
533 533
         // disable this state and update the current active speaker.
534 534
         if (isEnable) {
535
-            if (currentActiveSpeaker)
536
-                VideoLayout.enableActiveSpeaker(currentActiveSpeaker, false);
537
-            else
538
-                currentActiveSpeaker = resourceJid;
535
+            if (currentActiveSpeaker) {
536
+                var oldSpeaker = currentActiveSpeaker;
537
+                setTimeout(function () {
538
+                    VideoLayout.enableActiveSpeaker(oldSpeaker, false);
539
+                    }, 200);
540
+            }
541
+
542
+            currentActiveSpeaker = resourceJid;
539 543
         }
540 544
         else if (resourceJid === currentActiveSpeaker)
541 545
             currentActiveSpeaker = null;
@@ -565,7 +569,7 @@ var VideoLayout = (function (my) {
565 569
         }
566 570
         else {
567 571
             activeSpeakerCanvas = activeSpeakerCanvas.get(0);
568
-        } 
572
+        }
569 573
 
570 574
         if (videoElement && videoElement.length > 0) {
571 575
             var video = document.getElementById(videoElement.get(0).id);

Loading…
Cancel
Save