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

This commit is contained in:
hristoterezov 2014-10-03 15:33:00 +03:00
parent fea751bbb7
commit 0e7e2da168
1 changed files with 9 additions and 7 deletions

View File

@ -13,12 +13,13 @@ function SessionBase(connection, sid){
SessionBase.prototype.modifySources = function (successCallback) {
var self = this;
this.peerconnection.modifySources(function(){
$(document).trigger('setLocalDescription.jingle', [self.sid]);
if(successCallback) {
successCallback();
}
});
if(this.peerconnection)
this.peerconnection.modifySources(function(){
$(document).trigger('setLocalDescription.jingle', [self.sid]);
if(successCallback) {
successCallback();
}
});
};
SessionBase.prototype.addSource = function (elem, fromJid) {
@ -239,6 +240,7 @@ SessionBase.prototype.toggleVideoMute = function (callback) {
localVideo.getVideoTracks()[idx].enabled = !localVideo.getVideoTracks()[idx].enabled;
}
this.peerconnection.hardMuteVideo(!ismuted);
if(this.peerconnection)
this.peerconnection.hardMuteVideo(!ismuted);
this.modifySources(callback(!ismuted));
};