Event handlers in RTCPeerConnection

None of the event handlers for RTCPeerConnection have specific types
associated with the event.

This might be OK for the "stuff just happened events":
             attribute EventHandler          onnegotationneeded;
             attribute EventHandler          onopen;

Each of the following produces an event that includes additional attributes:
             attribute EventHandler          onicecandidate;
 - candidate : RTCIceCandidate
             attribute EventHandler          onstatechange;
 - state : RTCPeerState
             attribute EventHandler          onaddstream;
 - stream : MediaStream
             attribute EventHandler          onremovestream;
 - stream : MediaStream ?
             attribute EventHandler          ongatheringchange;
 - state : RTCGatheringState
             attribute EventHandler          onicechange;
 - state : RTCIceState
             attribute EventHandler          onidentityresult;
 - assertion : RTCIdentityAssertion
 - verified : boolean

Rather than using the generic EventHandler for each of these events, a
specific, typed callback function for each these would make
documentation easier.  That callback would take a subclass of Event
that included the extra attributes.

Obviously, for some of these it could be just a matter of following
through e.target.iceState or something like that, but others contain
vital information.  It would be nice if this could be more clearly
documented.

--Martin

Received on Wednesday, 26 September 2012 19:57:21 UTC