W3C home > Mailing lists > Public > public-webrtc@w3.org > September 2011

RE: MediaStreamTrack disabling - effect on downstream MediaStreams?

From: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Mon, 19 Sep 2011 16:01:38 +0200
To: Tommy Widenflycht (ᛏᚮᛘᛘᚤ) <tommyw@google.com>, Harald Alvestrand <harald@alvestrand.no>
CC: "public-webrtc@w3.org" <public-webrtc@w3.org>
Message-ID: <A1249B08688639468D1CB181445EE79D31BEA06F25@ESESSCMS0355.eemea.ericsson.se>
On 2011-09-15 20:08, Tommy Widenflycht (ᛏᚮᛘᛘᚤ) wrote:
> Suggestion: can the enabled attribute of a MediaStreamTrack take into 
> account its own state as well as its parent(s) state? This would make 
> it very easy to find out if a track is on or off.
>
> Example:
>
> var mediaStream2 = new MediaStream(mediaStream1);
>
> // mediaStream1.tracks[0].enabled == true // 
> mediaStream2.tracks[0].enabled == true
>
> mediaStream1.tracks[0].enabled = false;
>
> // mediaStream1.tracks[0].enabled == false // 
> mediaStream2.tracks[0].enabled == false
>
> mediaStream2.tracks[0].enabled = false;
>
> // mediaStream1.tracks[0].enabled == false // 
> mediaStream2.tracks[0].enabled == false
>
> mediaStream1.tracks[0].enabled = true;
>
> // mediaStream1.tracks[0].enabled == true // 
> mediaStream2.tracks[0].enabled == false

Since your tracks can have different states in the parent and the child,
it's clearly separate MediaStreamTrack instances, but they are still
related somehow. It seems from your example that tracks in forked
streams have a tri-state, "not set" (ask parent), "enabled", and
"disabled", is that correct? This would make it possible to build tree
structures of MediaStreamTracks where you would have to traverse the
tree to find the enable/disable state of a track.

I can see a point with a master enable/disable switch here, but
depending on which track in the tree you enable or disable it would have
a different number of side-effects which could be confusing for web
developers.

BR
Adam
Received on Monday, 19 September 2011 14:02:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 19 September 2011 14:02:06 GMT