Closed feross closed 7 years ago
First PR, review please: https://github.com/feross/simple-peer/pull/123
Okay, this is all fixed now! Lots of good stuff is in here now, including support for the new spec-compliant getStats()
report format.
This new format is available in Chrome today if you enable "Experimental Web Platform Features". It will ship in Chrome 58 and simple-peer
will be ready for it. I'm not sure when Firefox is shipping a spec-compliant format, but this should work for that too.
6.2.0
I've been playing with the code that decides which version of
RTCPeerConnection.prototype.getStats
gets called to add support for , and it's unfortunately pretty finicky.There are at least 3 implementations that I know of:
electron-webrtc
,node-wrtc
react-native-webrtc
It's not easy to feature detect which version is available, so we have to resort to user agent sniffing.
I propose that we:
peer._browserDetect()
function so all the browser sniffing nastiness is isolated to a single function.node-wrtc
, to catch regressions. (Hopefully it's easier to build these days).electron-webrtc
.try-catch
around thegetStats
calls in case detection fails, or a user is using a very old or new version of a browser that has switched implementations (or a Chrome user who turned on "Experimental Web Platform Features")