Sorry for not responding sooner. Here's an example that uses getStats
https://bugzilla.mozilla.org/attachment.cgi?id=8348790
..: Jan-Ivar :.
On 1/31/14 12:25 PM, Jamie McDonnell wrote:
Hi Adam,
thanks a lot for the quick response!
I see the development from 27 > 29, and will get nightly installed so I am
using the latest.
I am providing the MediaStreamTrack, success and error handlers, and they are
working - do I need to pull the stats out by name or something? I'm sure I'm
overlooking something simple ;)
pc2.getStats(videoStream, function(rawStats) {
updateStatsInMozilla(rawStats, pc2);
}, function(e){console.log("getStats error: ", e)});
I then get stuck actually pulling the stats out:
function updateStatsInMozilla(stats, pc2){
stats.has(function(h){
console.log("has: ", h);
);
console.log("stats.get(0)", stats.get(0));
for (key in stats.get(0)){
console.log("blob: ", stats.get(0)[key]);
}
for (var key in stats) {
var res = stats[key];
stats.forEach(function(res) {
counters2[res.type] = toNum(counters2[res.type]) + 1;
console.log("forEach: ", counters2, res);
});
}
Thanks again for the help ;)
Jamie
________________________________
Jamie McDonnell | User Experience Design Evangelist and Developer | eFace2Face
mobile: (+420) 777 608 442 | email:
[email protected]<mailto:[email protected]> | web:
eface2face.com<http://www.eface2face.com/>
[eface2face logo] <http://www.eface2face.com/>
[View our company profile on LinkedIn]
<http://www.linkedin.com/company/eface2face>
This electronic communication and any files transmitted with it, or attached to
it, are confidential and are intended solely for the use of the individual or
entity to who it is addressed and may contain information that is confidential,
legally privileged, protected by privacy laws, or otherwise restricted from
disclosure to anyone else. If you are not the intended recipient or the person
responsible for delivering the e-mail to the intended recipient, be advised
that you have received this e-mail in error, and that any use, dissemination,
forwarding, printing, or copying of this e-mail is strictly prohibited. If you
received this e-mail in error, please return the e-mail to the sender, delete
it from your computer and destroy any printed copy of it. Although our company
attempts to sweep e-mail and attachments for viruses, it does not guarantee
that either are virus-free and accepts no liability for any damage sustained as
a result of viruses.
________________________________
________________________________
From: Adam Roach <[email protected]>
Sent: 31 January 2014 17:23
To: Jamie McDonnell; [email protected]
Subject: Re: peerConnection getStats
On 1/31/14 09:54, Jamie McDonnell wrote:
I get an error saying "not enough arguments provided" but I can find no
documentation as to which arguments might be needed, and those I have tried have not
provided the key!
It wants a MediaStreamTrack (null should be valid), a success callback, and an
error callback; these are documented in the W3C WebRTC spec:
http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcpeerconnection-interface-extensions-2
Note that the definition of the stats interface in the W3C is still in flux,
and we're adding new ones with each release at the moment. For example, compare
the stats that Firefox 27 exposes:
http://mxr.mozilla.org/mozilla-beta/source/dom/webidl/RTCStatsReport.webidl
With those from Firefox 29:
http://mxr.mozilla.org/mozilla-central/source/dom/webidl/RTCStatsReport.webidl
--
Adam Roach
Principal Platform Engineer
[email protected]<mailto:[email protected]>
+1 650 903 0800 x863
_______________________________________________
dev-media mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-media