add getStats() to core.peerconnection

This adds a function named `getStats` to `core.peerconnection` which exposes a subset of `RTCPeerConnection.getStats`'s output, namely the local and remote peer-to-peer connection endpoints.

I haven't added tests yet -- am keen to get your thoughts first. I think in future we'll want to add other fields exposed by `getStats` such as bytes sent, jitter, etc. etc.

BTW, I guess we could just add this to the provider (as discussed during the hackathon) but I figure this will be useful to others, too, so long as we note that it's still somewhat experimental.
One of those in-between things. We might be best breaking up into platform
specific providers until this stuff gets unified. Thoughts!?
On Jun 25, 2014 8:11 PM, "Will" <notifications@github.com> wrote:

> In providers/core/peerconnection.unprivileged.js:
>
> > @@ -475,6 +483,40 @@ PeerConnection.prototype.getBufferedAmount = function (channelId, continuation)
> >    continuation(this.peer.getBufferedAmount(channelId));
> >  };
> >
> > +// TODO: handle Firefox stats
> > +PeerConnection.prototype.getStats = function (continuation) {
> > +  var callback = function(stats) { // RTCStatsResponse
> > +    var reports = stats.result(); // RTCStatsReport
> > +    // We need to find the report having a stat named 'googActiveConnection'.
>
> what tags a connection 'googActiveConnection'? is this going to work in
> firefox, or is a chrome out-of-spec thing?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/freedomjs/freedom/pull/70/files#r14219885>.
>