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
         // If there's an active speaker (automatically) selected we have to
532
         // If there's an active speaker (automatically) selected we have to
533
         // disable this state and update the current active speaker.
533
         // disable this state and update the current active speaker.
534
         if (isEnable) {
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
         else if (resourceJid === currentActiveSpeaker)
544
         else if (resourceJid === currentActiveSpeaker)
541
             currentActiveSpeaker = null;
545
             currentActiveSpeaker = null;
565
         }
569
         }
566
         else {
570
         else {
567
             activeSpeakerCanvas = activeSpeakerCanvas.get(0);
571
             activeSpeakerCanvas = activeSpeakerCanvas.get(0);
568
-        } 
572
+        }
569
 
573
 
570
         if (videoElement && videoElement.length > 0) {
574
         if (videoElement && videoElement.length > 0) {
571
             var video = document.getElementById(videoElement.get(0).id);
575
             var video = document.getElementById(videoElement.get(0).id);

Loading…
Cancel
Save