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. 15
      static/js/mediastream/usermedia.js

15
static/js/mediastream/usermedia.js

@ -285,7 +285,11 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr @@ -285,7 +285,11 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr
}
}
if (this.renegotiation && this.audioMute && this.videoMute) {
var constraints = $.extend(true, {}, mediaConstraints);
if (this.renegotiation) {
if (this.audioMute && this.videoMute) {
// Fast path as nothing should be shared.
_.defer(_.bind(function() {
this.onUserMediaSuccess(new DummyStream());
@ -294,7 +298,6 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr @@ -294,7 +298,6 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr
return true
}
var constraints = $.extend(true, {}, mediaConstraints);
if (this.audioMute) {
constraints.audio = false;
}
@ -302,6 +305,8 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr @@ -302,6 +305,8 @@ define(['jquery', 'underscore', 'audiocontext', 'mediastream/dummystream', 'webr
constraints.video = false;
}
}
try {
console.log('Requesting access to local media with mediaConstraints:\n' +
' \'' + JSON.stringify(constraints) + '\'', constraints);
@ -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