Query: Callback in PeerConnection constructor - appropriate?

Hi,

this is a floating query...... something I don't understand, so I'm asking.

In the current JSEP draft, we have:

    [Constructor (in DOMString configuration, in IceCallback iceCb)]
    interface PeerConnection {

..... and then later ....

              attributeFunction?       onconnecting  <http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-PeerConnection-onconnecting>;
              attributeFunction?       onopen  <http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-PeerConnection-onopen>;
              attributeFunction?       onstatechange  <http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-PeerConnection-onstatechange>;
              attributeFunction?       onaddstream  <http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-PeerConnection-onaddstream>;
              attributeFunction?       onremovestream  <http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-PeerConnection-onremovestream>;


Now, setting this in the constructor has two properties:
- It can never be NULL
- It can never be changed

In the old API, it kind of made sense, because the API would never work 
without this function.
In the new API, .... perhaps not so much.

What would people think of changing the ICE callback into an 
"onicecandidate" attribute Function, and leaving the configuration 
(which needs to go form a string to a dict too) alone in the constructor?

                            Harald

Received on Monday, 12 March 2012 13:06:53 UTC