[whatwg] Muting MediaStreamTracks?

Ian Hickson ian at hixie.ch
Mon Jul 18 11:33:28 PDT 2011


On Mon, 18 Jul 2011, Tommy Widenflycht (á~[~Oá~Z®á~[~Xá~[~Xá~Z¤) wrote:
>
> The latest version of the spec mentions muting in several places, for 
> example:
> 
>  (Merely muted tracks are not removed, so the tracks do not change when 
> the parent is finished.)
> 
> But there are no mute operators in the idl definitions... How is the 
> mute function supposed to work?

A MediaStream object has an input and an output. The input depends on how 
the object was created: a LocalMediaStream object generated by a 
getUserMedia() call, for instance, might take its input from the user's 
local camera, while a MediaStream created by a PeerConnection object will 
take as input the data received from a remote peer. The output of the 
object controls how the object is used, e.g. what is saved if the object 
is written to a file, what is displayed if the object is used in a video 
element, or indeed what is transmitted to a remote peer if the object is 
used with a PeerConnection object.

Each track in a MediaStream object can be disabled, meaning that it is 
muted in the object's output. All tracks are initially enabled.

A MediaStream can be finished, indicating that its inputs have forever 
stopped providing data. When a MediaStream object is finished, all its 
tracks are muted regardless of whether they are enabled or disabled.

The MediaStreamTrack.enabled attribute, on getting, must return the last 
value to which it was set. On setting, it must be set to the new value, 
and then, if the MediaStreamTrack object is still associated with a track, 
must enable the track if the new value is true, and disable it otherwise.

HTH,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list