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

webrtc-adapter

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webrtc-adapter - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

component.json

32

adapter.js

@@ -25,2 +25,20 @@ /*jslint node:true*/

var fixChromeStatsResponse = function(response) {
var standardReport = {};
var reports = response.result();
reports.forEach(function(report) {
var standardStats = {
id: report.id,
timestamp: report.timestamp,
type: report.type
};
report.names().forEach(function(name) {
standardStats[name] = report.stat(name);
});
standardReport[standardStats.id] = standardStats;
});
return standardReport;
};
// Unify PeerConnection Object.

@@ -35,3 +53,15 @@ if (typeof RTCPeerConnection !== 'undefined') {

} else if (typeof webkitRTCPeerConnection !== 'undefined') {
myRTCPeerConnection = webkitRTCPeerConnection;
// Chrome returns a nonstandard, non-JSON-ifiable response from getStats.
myRTCPeerConnection = function(configuration, constraints) {
var pc = new webkitRTCPeerConnection(configuration, constraints);
var boundGetStats = pc.getStats.bind(pc);
pc.getStats = function(selector, successCallback, failureCallback) {
var successCallbackWrapper = function(chromeStatsResponse) {
successCallback(fixChromeStatsResponse(chromeStatsResponse));
};
// Chrome also takes its arguments in the wrong order.
boundGetStats(successCallbackWrapper, failureCallback, selector);
};
return pc;
};
}

@@ -38,0 +68,0 @@

2

package.json
{
"name": "webrtc-adapter",
"version": "0.0.3",
"version": "0.0.4",
"description": "Commonjs adapter.js browser compatibility shim for webRTC",

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

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