MediaStreamTrack Lifecycle and Media Flow

Hi

I was asked by the editor's team to write up a proposal on some new text 
for the spec that clarifies the enabled/muted states of MediaStreamTrack.

This is largely based on Martin's mail [1] on this topic, with a simpler 
state enum and enabled and muted as individual attributes.

/Adam

[1] 
http://lists.w3.org/Archives/Public/public-media-capture/2013Mar/0093.html

===================================================

*** MediaStreamTrack Lifecycle and Media Flow ***

The MediaStreamTrack interface lets the script control a single flow of 
media. The live state indicates that the track source is active and the 
track renders media.

A muted or disabled track renders either silence (audio), black frames 
(video), or a zero-information-content equivalent. The muted/unmuted 
state of a track reflects if the source provides any media at this 
moment. The enabled/disabled state is under application control and 
determines if the track outputs media (to its consumers). Hence, media 
from the source only flows when a track is both unmuted and enabled.

A track is muted when the source is temporarily unable to provide the 
track with data. A track can be muted by a user. Often this action is 
outside the control of the application. This could be as a result of the 
user hitting a hardware switch, or toggling a control in the operating 
system or browser chrome. A track can also be muted by the user agent. 
For example, a track that is a member of a MediaStream, received via a 
RTCPeerConnection, is muted if the application on the other side 
disables the corresponding track in the MediaStream being sent. (Add 
text about firing muted/unmuted events)

Applications are able to enable or disable a track to prevent it from 
rendering media from the source. A muted track will however, regardless 
of the enabled state, render silence and blackness. A disabled track is 
logically equivalent to a muted track, from a consumer point of view.

interface MediaStreamTrack {
     ...
                 attribute boolean               enabled;

     readonly    attribute boolean               muted;
                 attribute EventHandler          onmute;
                 attribute EventHandler          onunmute;

     readonly    attribute MediaStreamTrackState readyState;
                 attribute EventHandler          onstarted;
                 attribute EventHandler          onended;
     ...
};

enum MediaStreamTrackState {
     "new",
     "live",
     "ended"
};

Received on Tuesday, 16 April 2013 12:02:24 UTC