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

rtcpeerconnection

Package Overview
Dependencies
Maintainers
3
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 2.1.1 to 2.2.0

test/getstats.js

4

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

@@ -21,3 +21,3 @@ "main": "rtcpeerconnection.js",

"webrtcsupport": "0.7.x",
"traceablepeerconnection": "0.1.x",
"traceablepeerconnection": "0.2.x",
"sdp-jingle-json": "1.x",

@@ -24,0 +24,0 @@ "underscore": "1.x"

@@ -361,2 +361,33 @@ var _ = require('underscore');

// a wrapper around getStats which hides the differences (where possible)
PeerConnection.prototype.getStats = function (cb) {
if (webrtc.prefix === 'moz') {
this.pc.getStats(
function (res) {
var items = [];
res.forEach(function (result) {
items.push(result);
});
cb(null, items);
},
cb
);
} else {
this.pc.getStats(function (res) {
var items = [];
res.result().forEach(function (result) {
var item = {};
result.names().forEach(function (name) {
item[name] = result.stat(name);
});
item.id = result.id;
item.type = result.type;
item.timestamp = result.timestamp;
items.push(item);
});
cb(null, items);
});
}
};
module.exports = PeerConnection;

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