Browse Source

Fixed problem where Chrome thought it already has an offer because the SDP is empty string instead of returning null for remoteOffer.

pull/209/merge
Simon Eisenmann 10 years ago
parent
commit
2a8fc4719b
  1. 10
      static/js/mediastream/peerconnection.js
  2. 2
      static/js/mediastream/webrtc.js

10
static/js/mediastream/peerconnection.js

@ -268,6 +268,16 @@ define(['jquery', 'underscore', 'webrtc.adapter'], function($, _) { @@ -268,6 +268,16 @@ define(['jquery', 'underscore', 'webrtc.adapter'], function($, _) {
};
PeerConnection.prototype.hasRemoteDescription = function() {
// NOTE(longsleep): Chrome seems to return empty sdp even if no remoteDescription was set.
if (!this.pc || !this.pc.remoteDescription || !this.pc.remoteDescription.sdp) {
return false
}
return true;
};
PeerConnection.prototype.setRemoteDescription = function() {
return this.pc.setRemoteDescription.apply(this.pc, arguments);

2
static/js/mediastream/webrtc.js

@ -237,7 +237,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u @@ -237,7 +237,7 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
console.log("Offer process.");
targetcall = this.findTargetCall(from);
if (targetcall) {
if (!this.settings.renegotiation && targetcall.peerconnection && targetcall.peerconnection.pc && targetcall.peerconnection.pc.remoteDescription) {
if (!this.settings.renegotiation && targetcall.peerconnection && targetcall.peerconnection.hasRemoteDescription()) {
// Call replace support without renegotiation.
this.doHangup("unsupported", from);
console.error("Processing new offers is not implemented without renegotiation.");

Loading…
Cancel
Save