simple-peer icon indicating copy to clipboard operation
simple-peer copied to clipboard

Support spec-compliant getStats() only

Open feross opened this issue 7 years ago • 3 comments

"Firefox has supported getStats to the spec for a couple of years now, and Chrome Canary finally has a spec-compliant version, so it’s a good time to check in how to write code that (soon!) will work across browsers."

https://blog.mozilla.org/webrtc/fiddle-week-spec-compliant-getstats/

Once Canary progresses to stable (in ~12 weeks), we should consider only supporting the promises version. Other implementations can just assume no getStats exists, which only means that remoteAddress, remotePort properties will be undefined. No big deal.

feross avatar Mar 01 '17 18:03 feross

Bump! <3

eordano avatar Mar 24 '20 03:03 eordano

@eordano it is already supported actually: https://github.com/feross/simple-peer/blob/947d873540ee337f990ce00a341de4a7aea1cacc/index.js#L697-L706

nazar-pc avatar Mar 24 '20 08:03 nazar-pc

Hi there! Doesn't this issue refer to deprecating the other version? In any case -- I think this can be closed down.

I think I run into an issue related to this code path because of the inclusion of one shim over the other -- for some reason getStats.length became 1; and it was receiving a callback (error didn't have to do with simple-peer, but this issue would be a cool "clean up").

Original discussion here: https://github.com/feross/simple-peer/issues/470 ( TypeError: Argument 1 of RTCPeerConnection.getStats does not implement interface MediaStreamTrack.)

eordano avatar Mar 24 '20 14:03 eordano