getStats
getStats copied to clipboard
getStats is a tiny JavaScript library using WebRTC getStats API to return peer connection stats i.e. bandwidth usage, packets lost, local/remote ip addresses and ports, type of connection etc.
We don't have the `isRemote` attribute with `react-native-webrtc`. But we can compute it using the `type` of the stat.
Hello As I understand to get info about used codec we call RTCPeerConnection.getStats Am I right? And find type == 'codec' Please tell me what next?
getStats v1.2.0 Firefox 89.0 (64-bit) this example: https://www.webrtc-experiment.com/getStats/ I'm getting this error: ```javascript getStatsResult.audio[sendrecvType] is undefined getStats/getStatsParser.checkAudioTracks@https://cdn.webrtc-experiment.com/getStats.js:368:13 getStatsLooper/
getStats v1.2.0 When i use in FireFox 69.0 (64-bit) this example https://rtcmulticonnection.herokuapp.com/demos/getStats.html I get an error in the console: > getStatsResult.video[sendrecvType] is undefined getStats/getStatsParser.checkVideoTracks@https://rtcmulticonnection.herokuapp.com/node_modules/getstats/getStats.js:453:13 > getStatsLooper/ getStatsLooper https://rtcmulticonnection.herokuapp.com/node_modules/getstats/getStats.js:257 > getStatsLooper...
On iOS using `react-native-webrtc` I've got this error : ``` undefined is not an object (evaluating 'getStatsResult.audio[sendrecvType].codecs') ``` FIxed it by checking for `getStatsResult.audio[sendrecvType]` befor using it.
Is it possible to use getStats in a Nightwatch test to get the stats from a WebRTC Videoconference test from a certain website (like Nextcloud Talk, Jitsi meet and 3CX...
How can I get these stats: bandwidth usage, packets lost, local/remote ip addresses and ports, type of connection etc and use them in my [KITE](https://github.com/webrtc/KITE) Project ?
Closes #21
https://github.com/muaz-khan/getStats/blob/master/dev/getStats.js#L39 ```js if (getStatsResult.audio && getStatsResult.video) { getStatsResult.bandwidth.speed = (getStatsResult.audio.bytesSent - getStatsResult.bandwidth.helper.audioBytesSent) + (getStatsResult.video.bytesSent - getStatsResult.bandwidth.helper.videoBytesSent); getStatsResult.bandwidth.helper.audioBytesSent = getStatsResult.audio.bytesSent; getStatsResult.bandwidth.helper.videoBytesSent = getStatsResult.video.bytesSent; } ```
Is there any way to check if remote PC has bad stream/network quality make the Webrtc call has bad user experience?