Procházet zdrojové kódy

Fixes an issue when the local user is alone in the conference and he mutes his video.

master
hristoterezov před 11 roky
rodič
revize
0e7e2da168
1 změnil soubory, kde provedl 9 přidání a 7 odebrání
  1. 9
    7
      libs/strophe/strophe.jingle.sessionbase.js

+ 9
- 7
libs/strophe/strophe.jingle.sessionbase.js Zobrazit soubor

@@ -13,12 +13,13 @@ function SessionBase(connection, sid){
13 13
 
14 14
 SessionBase.prototype.modifySources = function (successCallback) {
15 15
     var self = this;
16
-    this.peerconnection.modifySources(function(){
17
-        $(document).trigger('setLocalDescription.jingle', [self.sid]);
18
-        if(successCallback) {
19
-            successCallback();
20
-        }
21
-    });
16
+    if(this.peerconnection)
17
+        this.peerconnection.modifySources(function(){
18
+            $(document).trigger('setLocalDescription.jingle', [self.sid]);
19
+            if(successCallback) {
20
+                successCallback();
21
+            }
22
+        });
22 23
 };
23 24
 
24 25
 SessionBase.prototype.addSource = function (elem, fromJid) {
@@ -239,6 +240,7 @@ SessionBase.prototype.toggleVideoMute = function (callback) {
239 240
         localVideo.getVideoTracks()[idx].enabled = !localVideo.getVideoTracks()[idx].enabled;
240 241
     }
241 242
 
242
-    this.peerconnection.hardMuteVideo(!ismuted);
243
+    if(this.peerconnection)
244
+        this.peerconnection.hardMuteVideo(!ismuted);
243 245
     this.modifySources(callback(!ismuted));
244 246
 };

Načítá se…
Zrušit
Uložit