FS-8543 #resolve [Improve mute handling on conference and WebRTC]

This commit is contained in:
Anthony Minessale
2015-11-16 11:31:27 -06:00
parent 39a4f262b8
commit 67491b102c
8 changed files with 77 additions and 24 deletions

View File

@@ -90,7 +90,8 @@
},
}, options);
this.enabled = true;
this.audioEnabled = true;
this.videoEnabled = true;
this.mediaData = {
@@ -360,7 +361,7 @@
$.FSRTC.prototype.getMute = function() {
var self = this;
return self.enabled;
return self.audioEnabled;
}
$.FSRTC.prototype.setMute = function(what) {
@@ -381,10 +382,39 @@
break;
}
self.enabled = audioTracks[i].enabled;
self.audioEnabled = audioTracks[i].enabled;
}
return !self.enabled;
return !self.audioEnabled;
}
$.FSRTC.prototype.getVideoMute = function() {
var self = this;
return self.videoEnabled;
}
$.FSRTC.prototype.setVideoMute = function(what) {
var self = this;
var videoTracks = self.localStream.getVideoTracks();
for (var i = 0, len = videoTracks.length; i < len; i++ ) {
switch(what) {
case "on":
videoTracks[i].enabled = true;
break;
case "off":
videoTracks[i].enabled = false;
break;
case "toggle":
videoTracks[i].enabled = !videoTracks[i].enabled;
default:
break;
}
self.videoEnabled = videoTracks[i].enabled;
}
return !self.videoEnabled;
}
$.FSRTC.prototype.createAnswer = function(params) {

View File

@@ -2226,6 +2226,16 @@
return dialog.rtc.getMute();
};
$.verto.dialog.prototype.setVideoMute = function(what) {
var dialog = this;
return dialog.rtc.setVideoMute(what);
};
$.verto.dialog.prototype.getVideoMute = function() {
var dialog = this;
return dialog.rtc.getVideoMute();
};
$.verto.dialog.prototype.useStereo = function(on) {
var dialog = this;