rtcpeerconnection
Advanced tools
Comparing version 3.0.6 to 3.0.7
{ | ||
"name": "rtcpeerconnection", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "A tiny browser module that normalizes and simplifies the API for WebRTC peer connections.", | ||
@@ -5,0 +5,0 @@ "main": "rtcpeerconnection.js", |
@@ -72,3 +72,20 @@ var _ = require('underscore'); | ||
// EXPERIMENTAL FLAG, might get removed without notice | ||
// working around https://bugzilla.mozilla.org/show_bug.cgi?id=1087551 | ||
// pass in a timeout for this | ||
if (webrtc.prefix === 'moz') { | ||
if (constraints && constraints.optional) { | ||
this.wtFirefox = 0; | ||
constraints.optional.forEach(function (constraint, idx) { | ||
if (constraint.andyetFirefoxMakesMeSad) { | ||
self.wtFirefox = constraint.andyetFirefoxMakesMeSad; | ||
if (self.wtFirefox > 0) { | ||
self.firefoxcandidatebuffer = []; | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
this.pc = new peerconn(config, constraints); | ||
@@ -237,2 +254,10 @@ | ||
if (this.wtFirefox && this.firefoxcandidatebuffer !== null) { | ||
// we cant add this yet due to https://bugzilla.mozilla.org/show_bug.cgi?id=1087551 | ||
if (this.pc.localDescription && this.pc.localDescription.type === 'offer') { | ||
this.firefoxcandidatebuffer.push(update.candidate); | ||
return cb(); | ||
} | ||
} | ||
self.pc.addIceCandidate( | ||
@@ -463,2 +488,18 @@ new webrtc.IceCandidate(update.candidate), | ||
function () { | ||
if (self.wtFirefox) { | ||
window.setTimeout(function () { | ||
self.firefoxcandidatebuffer.forEach(function (candidate) { | ||
// add candidates later | ||
self.pc.addIceCandidate( | ||
new webrtc.IceCandidate(candidate), | ||
function () { }, | ||
function (err) { | ||
self.emit('error', err); | ||
} | ||
); | ||
self._checkRemoteCandidate(candidate.candidate); | ||
}); | ||
self.firefoxcandidatebuffer = null; | ||
}, self.wtFirefox); | ||
} | ||
cb(null); | ||
@@ -465,0 +506,0 @@ }, |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
190320
14
4979