Re: IDL/API feedback

Hi

Thank you for reviewing the document. Find answers inline.

On 2013-04-07 12:57, Anne van Kesteren wrote:
> 1) MediaStreamTrack needs to inherit from EventTarget.
>
> 2) The addtrack and removetrack events are not defined. In particular,
> when they are dispatched.

Both of the above issues were fixed recently, but haven't made it into a 
released version yet. They are available on github [1].

> 3) The constructor for MediaStream should probably a sequence of
> MediaStreamTrack, not an IDL array.

It's not a big deal, but wouldn't a sequence introduce an extra (and 
unnecessary) copy of the array when it's passed by value? Are there any 
general guidelines for array-like input arguments? I've seen that at 
least the WebSocket constructor uses a DOMString[] for its protocols 
argument.

> 4) "Constructor ()" should just be "Constructor", but maybe better
> would be to make the single argument optional and use "or" to
> distinguish the two types.

Like this?

Constructor (optional (MediaStream or MediaStreamTrack[]) trackContainer)

What would work for me. The tricky thing is to come up with a suitable 
name for the single argument. It's easier when you simply can call it 
"data". :)

/Adam

[1] 
http://htmlpreview.github.io/?https://github.com/fluffy/webrtc-w3c/blob/master/getusermedia.html 
(note that links don't work)

Received on Monday, 8 April 2013 05:08:50 UTC