- From: Martin Thomson <martin.thomson@gmail.com>
- Date: Thu, 7 Feb 2013 11:56:57 -0500
- To: "public-webrtc@w3.org" <public-webrtc@w3.org>
Given the API that we decided to go with, here is code that will produce one line (to console) for each RTP stream that includes a timestamp and the ssrc for those streams. function statsCallback(allStats) { var stats = getStatsByType(allStats, 'RTPStreamStats'); stats.forEach(function(v) { console.log(v.timestamp + ' ' + v.id + ' ' + v.ssrc); }); } function getStatsByType(allStats, type) { return Object.keys(allStats).filter(function(id) { return allStats[id].type === allStats; }).map(function(id) { return allStats[id]; }); } Question: do we set type for an RTCStatsObject based on the most specific type? That would invalidate the filtering I'm doing here.
Received on Thursday, 7 February 2013 16:57:34 UTC