Selaa lähdekoodia

Fixes focus restore in the case of only 2 participants and one of them reloads.

j8
yanas 11 vuotta sitten
vanhempi
commit
68ff87d0ab
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7
    1
      app.js

+ 7
- 1
app.js Näytä tiedosto

@@ -38,6 +38,8 @@ var getVideoPosition;
38 38
 
39 39
 var preMuted = false;
40 40
 
41
+var sessionTerminated = false;
42
+
41 43
 function init() {
42 44
     RTC = setupRTC();
43 45
     if (RTC === null) {
@@ -495,6 +497,7 @@ $(document).bind('callactive.jingle', function (event, videoelem, sid) {
495 497
 $(document).bind('callterminated.jingle', function (event, sid, jid, reason) {
496 498
     // Leave the room if my call has been remotely terminated.
497 499
     if (connection.emuc.joined && focus == null && reason === 'kick') {
500
+        sessionTerminated = true;
498 501
         connection.emuc.doLeave();
499 502
         openMessageDialog(  "Session Terminated",
500 503
                             "Ouch! You have been kicked out of the meet!");
@@ -607,9 +610,12 @@ $(document).bind('left.muc', function (event, jid) {
607 610
     connection.jingle.terminateByJid(jid);
608 611
 
609 612
     if (focus == null
613
+            // I shouldn't be the one that left to enter here.
610 614
             && jid !== connection.emuc.myroomjid
611 615
             && connection.emuc.myroomjid === connection.emuc.list_members[0]
612
-            && connection.emuc.list_members.length > 1) {
616
+            // If our session has been terminated for some reason
617
+            // (kicked, hangup), don't try to become the focus
618
+            && !sessionTerminated) {
613 619
         console.log('welcome to our new focus... myself');
614 620
         focus = new ColibriFocus(connection, config.hosts.bridge);
615 621
         if (Object.keys(connection.emuc.members).length > 0) {

Loading…
Peruuta
Tallenna