So, I'm working on an application that uses WebRTC to provide video / audio communication between peers.
I would like to provide some feedback to users regarding their network connection / bandwidth / delay, etc., in order to suggest possible solutions if bandwidth, etc. terrible.
WebRTC has a getStats() API that provides several key pieces of information. When the peer connection is active, getStats() gives me the following object ...
{ "googLibjingleSession_5531731670954573009":{ "id":"googLibjingleSession_5531731670954573009", "timestamp":"2016-02-02T11:14:43.467Z", "type":"googLibjingleSession", "googInitiator":"true" }, "googTrack_SCEHhCOl":{ "id":"googTrack_SCEHhCOl", "timestamp":"2016-02-02T11:14:43.467Z", "type":"googTrack", "googTrackId":"SCEHhCOl" }, "ssrc_360347109_recv":{ "id":"ssrc_360347109_recv", "timestamp":"2016-02-02T11:14:43.467Z", "type":"ssrc", "googDecodingCTN":"757", "packetsLost":"0", "googSecondaryDecodedRate":"0", "googDecodingPLC":"3", "packetsReceived":"373", "googExpandRate":"0.00579834", "googJitterReceived":"0", "googDecodingCNG":"0", "ssrc":"360347109", "googPreferredJitterBufferMs":"20", "googSpeechExpandRate":"0.00140381", "googTrackId":"SCEHhCOl", "transportId":"Channel-audio-1", "googDecodingPLCCNG":"10", "googCodecName":"opus", "googDecodingNormal":"744", "audioOutputLevel":"6271", "googAccelerateRate":"0", "bytesReceived":"21796", "googCurrentDelayMs":"64", "googDecodingCTSG":"0", "googCaptureStartNtpTimeMs":"-1", "googPreemptiveExpandRate":"0.00292969", "googJitterBufferMs":"42" } }
It is with this information that I hope to count users ...
a) Bandwidth (ideally audio and video are separate, but straight-line bandwidth will be sufficient)
b) Network delay
Thanks in advance...
NB : I already saw this shell , but I would like it to be valid (with a little help, of course: D), since the code for this shell uses the "bytesSent" property, which does not seem to return from getStats() ?
I also know about the WebRTC test available on GitHub, but again, I should be able to achieve what I want without relying on third-party third-party plugins, etc.