Browse Source

Fixed a problem where streams could not be started when they are disabled when the call was started and the server has renegotiation disabled.

pull/226/head
Simon Eisenmann 11 years ago
parent
commit
b842bdf26b
  1. 39
      static/js/mediastream/usermedia.js

39
static/js/mediastream/usermedia.js

@ -285,21 +285,26 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr @@ -285,21 +285,26 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr
}
}
if (this.renegotiation && this.audioMute && this.videoMute) {
// Fast path as nothing should be shared.
_.defer(_.bind(function() {
this.onUserMediaSuccess(new DummyStream());
}, this));
this.started = true;
return true
}
var constraints = $.extend(true, {}, mediaConstraints);
if (this.audioMute) {
constraints.audio = false;
}
if (this.videoMute) {
constraints.video = false;
if (this.renegotiation) {
if (this.audioMute && this.videoMute) {
// Fast path as nothing should be shared.
_.defer(_.bind(function() {
this.onUserMediaSuccess(new DummyStream());
}, this));
this.started = true;
return true
}
if (this.audioMute) {
constraints.audio = false;
}
if (this.videoMute) {
constraints.video = false;
}
}
try {
@ -381,6 +386,12 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr @@ -381,6 +386,12 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr
}, this), 0);
}
if (!this.renegotiation) {
// Apply mute states after we got streams.
this.applyAudioMute(this.audioMute);
this.applyVideoMute(this.videoMute);
}
};
UserMedia.prototype.stop = function() {

Loading…
Cancel
Save