W3C home > Mailing lists > Public > public-webrtc@w3.org > September 2012

Event handlers in RTCPeerConnection

From: Martin Thomson <martin.thomson@gmail.com>
Date: Wed, 26 Sep 2012 12:56:54 -0700
Message-ID: <CABkgnnUwLzJRU4ZyL73weTXjQu32_EMsU83Ui3qwvTYsseQNCQ@mail.gmail.com>
To: public-webrtc@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 26 September 2012 19:57:23 GMT