Re: IDL/API feedback

On Mon, Apr 8, 2013 at 6:08 AM, Adam Bergkvist
<adam.bergkvist@ericsson.com> wrote:
> On 2013-04-07 12:57, Anne van Kesteren wrote:
>> 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].

The second issue does not appear to be fixed (the methods are not
dispatching these events). It's also unclear why you'd need a special
interface for this event given that you can get to the tracks on the
object already.


>> 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.

You need a copy. If you'd actually pass by value the developer could
make further changes later that would have to be reflected by the
object, which is not what you want at all.

With regards to WebSocket, that seems like a bug in WebSocket.


>> 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.
>
> 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". :)

You can call it data, it doesn't matter, but it should really be sequence.


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


--
http://annevankesteren.nl/

Received on Monday, 8 April 2013 07:21:35 UTC