W3C home > Mailing lists > Public > public-media-capture@w3.org > April 2014

Re: [Bug 25275] VideoTrackList.selectedIndex initialization confilicts with HTML5 spec, "if no track is selected".

From: Stefan Håkansson LK <stefan.lk.hakansson@ericsson.com>
Date: Tue, 15 Apr 2014 11:20:34 +0000
To: "kiran.guduru@samsung.com" <kiran.guduru@samsung.com>, Steev James <steev.a.james@gmail.com>
CC: "public-media-capture@w3.org" <public-media-capture@w3.org>
Message-ID: <1447FA0C20ED5147A1AA0EF02890A64B1CFD5AB7@ESESSMB209.ericsson.se>
On 2014-04-15 11:33, Kiran Kumar Guduru wrote:
> It is true that MediaElement spec is not specifying anything about
> initialization of selectedIndex.
>
> In MediaStreams spec, we will come across this scenario, "if no track is
> selected", after removing the selected track from VideoTracks (and when
> not selecting any other tracks in the list).

Re-reading the html draft, I get to the following understanding:

* For audio, any new tracks (tracks that are added to a MediaStream that 
is being played in a media element) gets status disabled in the media 
element's AduioTrackList. I.e. the application has to enable them 
(enabled=true) to have their audio played (mixed in with the other audio 
tracks).
* For video, any new track (tracks that are added to a MediaStream that 
is being played in a media element) gets status not-selected in the 
media element's VideoTrackList. I.e. the application has to select it 
(selected=true) to have its video played.
* For audio, removing a track does not affect the remaining tracks 
(their enabled property in the AudioTrack of the AudioTrackList of the 
media element remains).
* For video, removing a track does not affect the remaining ones, 
meaning that if the track being removed is the currently selected one, 
then no track will be selected after removal (and selectIndex of the 
media elements VideoTrackList will return -1).

I think there are no ambiguities so far.

The only outstanding thing would be the resource fetch phase. The text says

"If either the media resource [...] indicate a particular set of audio 
or video tracks to enable, or if the user agent has information that 
enabled it to select specific tracks for optimal performance, then the 
selected audio tracks must be enabled in the element's audioTracks 
object, and, of the selected video tracks, the one that is listed first 
in the element's videoTracks object must be selected."

What this means for a MediaStream is up to this group to define. What is 
currently said is that for all MediaStreamTracks of kind audio, the 
media element's corresponding AudioTrack should be initialised to 
"enabled" (and not take the enabled attribute of the corresponding 
MediaStreamTrack into account).

For video, it is said: "Set the VideoTrackList.selectedIndex to the 
index of the first VideoTrack, in the VideoTrackList, that corresponds 
to a MediaStreamTrack that is not muted or disabled. If no such 
VideoTrack exists, set the selectedIndex attribute to 0." I think '0' 
should be changed to '-1', but otherwise this is quite clear IMO. We 
could consider simplifying by not take the muted/disabled of the 
MediaStreamTrack into account, and just select one of the video tracks 
regardless of it being muted/disabled or not.

Stefan



>
> ------- *Original Message* -------
>
> *Sender* : Steev James<steev.a.james@gmail.com>
>
> *Date* : Apr 14, 2014 22:24 (GMT+09:00)
>
> *Title* : Re: [Bug 25275] VideoTrackList.selectedIndex initialization
> confilicts with HTML5 spec, "if no track is selected".
>
> Hmm,
> My reay intention is "if none of the tracks are selected" has no room in
> MediaStreams spec.
>
>
> On Mon, Apr 14, 2014 at 6:15 PM, Stefan Håkansson LK
> <stefan.lk.hakansson@ericsson.com
> <mailto:stefan.lk.hakansson@ericsson.com>> wrote:
>
>     On 2014-04-14 14:15, Steev James wrote:
>      > Stefan,
>      > This link is just specifying that AudioTracks / VideoTracks can have
>      > multiple tracks and,
>      > "The|VideoTrackList.selectedIndex|attribute must return the index
>     of the
>      > currently selected track, if any. If the|VideoTrackList
>      >
>     <http://www.w3.org/TR/html5/embedded-content-0.html#videotracklist>|object
>      > does not currently represent any tracks, or if none of the tracks are
>      > selected, it must instead return −1."
>
>     Hm, we must be talking past each other. I read your comment
>     'MediaElement spec has not mentioned anything about "how" to select a
>     track.', and responded to it because I think that is precisely what you
>     _can_ do with the enabled (audio) and selected (video) attributes.
>
>      >
>      >
>      > It is not mandating the default initialization to first track. But
>      > MediaStreams is mandating it to initialize it to '0' track of the
>     list.
>      > So "if none of the tracks are selected" has no room in
>     MediaStreams spec.
>      >
>      >
>      >
>      > On Mon, Apr 14, 2014 at 5:02 PM, Stefan Håkansson LK
>      > <stefan.lk.hakansson@ericsson.com
>     <mailto:stefan.lk.hakansson@ericsson.com>
>      > <mailto:stefan.lk.hakansson@ericsson.com
>     <mailto:stefan.lk.hakansson@ericsson.com>>> wrote:
>      >
>      >     On 2014-04-14 08:58, bugzilla@jessica.w3.org
>     <mailto:bugzilla@jessica.w3.org>
>      >     <mailto:bugzilla@jessica.w3.org
>     <mailto:bugzilla@jessica.w3.org>> wrote:
>      >      > https://www.w3.org/Bugs/Public/show_bug.cgi?id=25275
>      >      >
>      >      > steev <steev.a.james@gmail.com
>     <mailto:steev.a.james@gmail.com> <mailto:steev.a.james@gmail.com
>     <mailto:steev.a.james@gmail.com>>>
>      >     changed:
>      >      >
>      >      >             What    |Removed                     |Added
>      >      >
>      >
>     ----------------------------------------------------------------------------
>      >      >                   CC|
>      >       |steev.a.james@gmail.com <mailto:steev.a.james@gmail.com>
>     <mailto:steev.a.james@gmail.com <mailto:steev.a.james@gmail.com>>
>      >      >
>      >      > --- Comment #5 from steev <steev.a.james@gmail.com
>     <mailto:steev.a.james@gmail.com>
>      >     <mailto:steev.a.james@gmail.com
>     <mailto:steev.a.james@gmail.com>>> ---
>      >      > MediaElement spec has not mentioned anything about "how" to
>      >     select a track.
>      >
>      >
>     http://www.w3.org/TR/html5/embedded-content-0.html#media-resources-with-multiple-media-tracks
>      >     details this.
>      >
>      >      > Is
>      >      > there any special interst for specifying this in media
>     streams spec?
>      >      >
>      >
>      >
>      >
>
>
Received on Tuesday, 15 April 2014 11:20:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:26 UTC