rtcpeerconnection
Advanced tools
Comparing version 3.1.6 to 4.0.0
{ | ||
"name": "rtcpeerconnection", | ||
"version": "3.1.6", | ||
"version": "4.0.0", | ||
"description": "A tiny browser module that normalizes and simplifies the API for WebRTC peer connections.", | ||
@@ -5,0 +5,0 @@ "main": "rtcpeerconnection.js", |
@@ -816,36 +816,13 @@ var util = require('util'); | ||
// a wrapper around getStats which hides the differences (where possible) | ||
// TODO: remove in favor of adapter.js shim | ||
PeerConnection.prototype.getStats = function (cb) { | ||
if (adapter.webrtcDetectedBrowser === 'firefox') { | ||
this.pc.getStats( | ||
function (res) { | ||
var items = []; | ||
for (var result in res) { | ||
if (typeof res[result] === 'object') { | ||
items.push(res[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); | ||
}); | ||
} | ||
this.pc.getStats(null, | ||
function (res) { | ||
cb(null, res); | ||
}, | ||
function (err) { | ||
cb(err); | ||
} | ||
); | ||
}; | ||
module.exports = PeerConnection; |
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
239088
6466