getStats on closed peerConnection

I'd like to propose a change to getStats so that calling it on a closed 
PeerConnection does not throw, but instead gives you the stats at the 
time the PeerConnection closed.

Use-case: A webpage wants stats about the call that just terminated from 
the other side - e.g. how many frames dropped?

In [1] remove step 1:
>     1. If the ||RTCPeerConnection| 
> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection>| 
> object's |RTCPeerConnection| signalingState 
> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#dom-peerconnection-signaling-state> 
> is |closed|, throw an |InvalidStateError| exception. 

And edit step 5 (which would now be 4):

>     4. Start gathering the stats indicated by selectorArg. In case 
> selectorArg is null, stats /MUST/ be gathered for the whole 
> ||RTCPeerConnection| 
> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection>| 
> object. If the ||RTCPeerConnection| 
> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection>| 
> object's |RTCPeerConnection| signalingState 
> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#dom-peerconnection-signaling-state> 
> is |closed|, stats should reflect the state at or near the time that 
> signalingState 
> <http://dev.w3.org/2011/webrtc/editor/webrtc.html#dom-peerconnection-signaling-state> 
> transitioned to |closed|.

Implementations would basically cache a final call to getStats 
internally as part of transitioning to closed.

.: Jan-Ivar :.

[1] http://dev.w3.org/2011/webrtc/editor/webrtc.html#methods-5

Received on Wednesday, 20 August 2014 21:03:44 UTC