[whatwg] Enabling/disabling tracks in MediaStreams

Tommy Widenflycht (ᛏᚮᛘᛘᚤ) tommyw at google.com
Mon Jul 18 05:17:17 PDT 2011


I am very confused regarding the below paragraph from the latest spec:

When a track in a
MediaStream<http://www.whatwg.org/specs/web-apps/current-work/multipage/video-conferencing-and-peer-to-peer-communication.html#mediastream>
 parent is disabled, any
MediaStreamTrack<http://www.whatwg.org/specs/web-apps/current-work/multipage/video-conferencing-and-peer-to-peer-communication.html#mediastreamtrack>
 objects corresponding to the tracks in any
MediaStream<http://www.whatwg.org/specs/web-apps/current-work/multipage/video-conferencing-and-peer-to-peer-communication.html#mediastream>
 objects that were created from parent are disassociated from any track, and
must not be reused for tracks again. If a disabled track in a
MediaStream<http://www.whatwg.org/specs/web-apps/current-work/multipage/video-conferencing-and-peer-to-peer-communication.html#mediastream>
 parent is re-enabled, from the perspective of any
MediaStream<http://www.whatwg.org/specs/web-apps/current-work/multipage/video-conferencing-and-peer-to-peer-communication.html#mediastream>
 objects that were created from parent it is a new track and thus new
MediaStreamTrack<http://www.whatwg.org/specs/web-apps/current-work/multipage/video-conferencing-and-peer-to-peer-communication.html#mediastreamtrack>
 objects must be created for the tracks that correspond to the re-enabled
track.



After cloning a LocalMediaStream it looks like this:

LocalMediaStream -> MediaStream1
Track1(E)           Track1(E)
Track2(E)           Track2(E)
Track3(E)           Track3(E)

and as I interpret the spec it looks like this if Track1 in the
LocalMediaStream is disabled:

LocalMediaStream -> MediaStream1
Track1(D)           Track2(E)
Track2(E)           Track3(E)
Track3(E)

So Track1 disappears from the MediaStream1 object and doesn't come back even
if Track1 in the LMS object is enabled:

LocalMediaStream -> MediaStream1
Track1(E)           Track2(E)
Track2(E)           Track3(E)
Track3(E)

And to get it back again has to create a new MediaStream object from the
LMS:

LocalMediaStream -> MediaStream2
Track1(E)           Track1(E)
Track2(E)           Track2(E)
Track3(E)           Track3(E)

Is this interpretation correct?


/Tommy

 --
Tommy Widenflycht, Senior Software Engineer
Google Sweden AB, Kungsbron 2, SE-11122 Stockholm, Sweden
Org. nr. 556656-6880
And yes, I have to include the above in every outgoing email according to EU
law.


More information about the whatwg mailing list