Socket
Socket
Sign inDemoInstall

rtcpeerconnection

Package Overview
Dependencies
Maintainers
4
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rtcpeerconnection - npm Package Compare versions

Comparing version 3.0.4 to 3.0.5

test/dripice.js

2

package.json
{
"name": "rtcpeerconnection",
"version": "3.0.4",
"version": "3.0.5",
"description": "A tiny browser module that normalizes and simplifies the API for WebRTC peer connections.",

@@ -5,0 +5,0 @@ "main": "rtcpeerconnection.js",

@@ -48,2 +48,17 @@ var _ = require('underscore');

// EXPERIMENTAL FLAG, might get removed without notice
// bundle up ice candidates, only works for jingle mode
// number > 0 is the delay to wait for additional candidates
// ~20ms seems good
this.batchIceCandidates = 0;
if (constraints && constraints.optional) {
constraints.optional.forEach(function (constraint, idx) {
if (constraint.andyetBatchIce) {
self.batchIceCandidates = constraint.andyetBatchIce;
}
});
}
this.batchedIceCandidates = [];
this.pc = new peerconn(config, constraints);

@@ -178,5 +193,5 @@

if (update.contents) {
if (update.contents || (update.jingle && update.jingle.contents)) {
var contentNames = _.pluck(this.remoteDescription.contents, 'name');
var contents = update.contents;
var contents = update.contents || update.jingle.contents;

@@ -209,3 +224,3 @@ contents.forEach(function (content) {

// working around https://code.google.com/p/webrtc/issues/detail?id=3669
if (update.candidate.candidate.indexOf('a=') !== 0) {
if (update.candidate && update.candidate.candidate.indexOf('a=') !== 0) {
update.candidate.candidate = 'a=' + update.candidate.candidate;

@@ -579,2 +594,3 @@ }

};
this._checkLocalCandidate(ice.candidate);

@@ -615,4 +631,28 @@ var cand = SJJ.toCandidateJSON(ice.candidate);

};
if (self.batchIceCandidates > 0) {
if (self.batchedIceCandidates.length === 0) {
window.setTimeout(function () {
var contents = {};
self.batchedIceCandidates.forEach(function (content) {
content = content.contents[0];
if (!contents[content.name]) contents[content.name] = content;
contents[content.name].transport.candidates.push(content.transport.candidates[0]);
});
var newCand = {
jingle: {
contents: []
}
};
Object.keys(contents).forEach(function (name) {
newCand.jingle.contents.push(contents[name]);
});
self.batchedIceCandidates = [];
self.emit('ice', newCand);
}, self.batchIceCandidates);
}
self.batchedIceCandidates.push(expandedCandidate.jingle);
return;
}
}
this._checkLocalCandidate(ice.candidate);
this.emit('ice', expandedCandidate);

@@ -619,0 +659,0 @@ } else {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc