Browse Source

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

master
hristoterezov 11 years ago
parent
commit
0e7e2da168
1 changed files with 9 additions and 7 deletions
  1. 9
    7
      libs/strophe/strophe.jingle.sessionbase.js

+ 9
- 7
libs/strophe/strophe.jingle.sessionbase.js View File

13
 
13
 
14
 SessionBase.prototype.modifySources = function (successCallback) {
14
 SessionBase.prototype.modifySources = function (successCallback) {
15
     var self = this;
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
 SessionBase.prototype.addSource = function (elem, fromJid) {
25
 SessionBase.prototype.addSource = function (elem, fromJid) {
239
         localVideo.getVideoTracks()[idx].enabled = !localVideo.getVideoTracks()[idx].enabled;
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
     this.modifySources(callback(!ismuted));
245
     this.modifySources(callback(!ismuted));
244
 };
246
 };

Loading…
Cancel
Save