Re: Track cloning behavior of MediaStream() constructor and addTrack()

Maybe an explicit .clone() is the right answer, with one additional wrinkle:

Throw an exception if a track is already attached to a sink.

Then we can enforce a strict 1 source, 1 track, 1 sink cardinality
without strange and opaque behaviour.  Each track could have a 'sink'
attribute that exposes any existing attachment so that this limitation
is discoverable.  You can add text to the exception that recommends
.clone()-ing.

> On 2013-03-18 15:47, Adam Bergkvist wrote:
>> Hi
>>
>> As the spec is currently written, the MediaStream() constructor and
>> the
>> addTrack() method create a new MediaStreamTrack instance to represent
>> a given track argument. Some of the changes we done lately, like
>> removed the ordered track list attributes, have made this API harder to work with.

Received on Tuesday, 19 March 2013 15:57:28 UTC