Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.3 to 3.0.4

test_getstats.js

2

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

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

@@ -38,2 +38,11 @@ var _ = require('underscore');

}
// EXPERIMENTAL FLAG, might get removed without notice
this.restrictBandwidth = 0;
if (constraints && constraints.optional) {
constraints.optional.forEach(function (constraint, idx) {
if (constraint.andyetRestrictBandwidth) {
self.restrictBandwidth = constraint.andyetRestrictBandwidth;
}
});
}

@@ -477,2 +486,20 @@ this.pc = new peerconn(config, constraints);

}
if (self.restrictBandwidth > 0) {
answer.jingle = SJJ.toSessionJSON(answer.sdp, {
role: self._role(),
direction: 'outgoing'
});
if (answer.jingle.contents.length >= 2 && answer.jingle.contents[1].name === 'video') {
var content = answer.jingle.contents[1];
var hasBw = content.description && content.description.bandwidth;
if (!hasBw) {
answer.jingle.contents[1].description.bandwidth = { type:'AS', bandwidth: self.restrictBandwidth.toString() };
answer.sdp = SJJ.toSessionSDP(answer.jingle, {
sid: self.config.sdpSessionID,
role: self._role(),
direction: 'outgoing'
});
}
}
}
self.pc.setLocalDescription(answer,

@@ -479,0 +506,0 @@ function () {

Sorry, the diff of this file is too big to display

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