Re: Which videoTrack should be played in the <Video> element?

On 07/27/2012 11:47 PM, Travis Leithead wrote:
> The spec currently does not specify which videoTrack should be displayed
> in the <Video> element when the video element is consuming a
> MediaStream. When there is only one MediaStreamTrack in the videoTrack
> list, this is obvious. But it is somewhat less obvious what should
> happen when there are either:
>
> 1)No videoTracks (e.g., the user requested or received a MediaStream
> with only audioTracks present)
>
> 2)More than one videoTracks that are enabled (enabled-by-default as the
> spec says)
>
> May I suggest that the spec needs to address these two cases:
>
> 1.How should the video element consumer handle audio-only MediaStreams?
>
> 2.How should multiple videoTrack’s be addressed when consumed by a video
> element?
>
> For the multiple-video tracks case, the HTML5 video element handles this
> by toggling the tracks in its videoTracks list
> (http://dev.w3.org/html5/spec/single-page.html#videotracklist) such that
> only one video track is active at a time; it has the concept of a
> “selected” track and a “selectedIndex”.
>
> My proposal for MediaStreams is that audio-only MediaStreams (being
> consumed by a Video element) should result in a zero-sized media
> dimension, and we should be sure to note in the spec that the media
> element’s videoWidth/videoHeight attributes are set to zero.

I'm not sure we need to define anything more than is already in the 
HTML5 spec. There it is said more or less that
* If a poster is defined for the video element, it is to be showed until 
video data is available. This is intended to be used to show some image 
when video is not available.
* If the media resource (MediaStream in out case) has a video channel, 
"the element provides a paint source .... width=source intrinsic width 
.... height=source intrinsic height...".

So to me it is quite clear for the case when a MediaStream has no video 
track, and the web author instantiates a video element with that 
MediaStream as source:
* If a poster is defined, that has to be shown (with the right dimensions)
* If a poster is not defined, no paint source should be provided, and 
dimension would be zero by zero pixels (as the intrinsic width/height is 
zero).

My question would be, what happens if the author sets the width and 
height properties of the video element in this situation?
> For
> MediaStreams with multiple videoTracks, I suggest that we either adopt
> to model used by HTML5, or make the order of the Tracks significant,
> such that when there are multiple enabled/active video tracks in a
> MediaStream, the first active/enabled video track is the one that is
> played in the video element. Users can then set the enabled attribute to
> false, so that the video element falls back to the next available video
> track. For this scenario it might also be nice to furnish a “setEnabled”
> or “mute” API on the MediaStreamTrackList that takes a single unsigned
> long index as a parameter and makes the track at that given index
> enabled while disabling all other tracks.
>

Received on Monday, 30 July 2012 12:51:49 UTC