I'm trying to get stats of a webRTC app to measure audio/video streaming bandwidth. I checked this question and I found it very useful; however, when I try to use it I get
TypeError: Not enough arguments to RTCPeerConnection.getStats.
I think that is because of in 2016 something in webRTC is changed and now there are mediaStreamTracks; however I built the project without mediaStreamTracks and I don't know how to change this function to get it to work.
Do you have any ideas? Thanks for your support!
UPDATE:
My call is
peer.pc.onaddstream = function(event) {
peer.remoteVideoEl.setAttribute("id", event.stream.id);
attachMediaStream(peer.remoteVideoEl, event.stream);
remoteVideosContainer.appendChild(peer.remoteVideoEl);
getStats(peer.pc);
};
and getStats() is identical to this link at chapter n.7.
getStats()
– RobygetStats()
needs amediaStreamTrack
as parameter, if i recall. – Expertisepeer.getStats(null, function(...) )
? – Cudweednull
. – Azaria