W3C home > Mailing lists > Public > public-html-a11y@w3.org > March 2010

Re: Survey ready on Media Multitrack API proposal

From: Maciej Stachowiak <mjs@apple.com>
Date: Wed, 03 Mar 2010 19:27:14 -0800
Cc: Eric Carlson <eric.carlson@apple.com>, "Michael(tm) Smith" <mike@w3.org>, HTML Accessibility Task Force <public-html-a11y@w3.org>
Message-id: <7DCD8F9B-42DD-44C1-B7E8-BE1AD2A7CC0A@apple.com>
To: Silvia Pfeiffer <silviapfeiffer1@gmail.com>

On Mar 3, 2010, at 12:40 PM, Silvia Pfeiffer wrote:

> On Thu, Mar 4, 2010 at 3:33 AM, Eric Carlson  
> <eric.carlson@apple.com> wrote:
>> On Mar 2, 2010, at 11:14 PM, Silvia Pfeiffer wrote:
>>>> You also didn't answer my second question -  are track names  
>>>> typically
>>>> unique? Do media container formats generally guarantee the  
>>>> presence of
>>>> unique track names?
>>> There is no guarantee of their existence - same for the role
>>> attribute. But where they exist, they are unique.
>>  Track IDs (which are numeric) in QuickTime and MPEG-4 files are  
>> guaranteed to be unique, track names are not required and are *not*  
>> guaranteed to be unique.
> So maybe for MPEG the track ID is the one that should be mapped to the
> this field here as text? Or alternatively it could be a combination of
> track name and the track ID?

It seems like you can always provide a numeric indexing API to the  
tracks regardless of the media format. How about we make that the  
primary way to query for a track, and leave the name as an informative  

Using a numeric ID as a string name would be particularly confusing  
with the proposed API, since there are both name and index getters.  
Let's say you have a track that is first in the MediaTracks list, and  
it has a numeric track ID of "2".

You might expect that myVideoElement.tracks["2"] will get the track  
with ID 2. But it will instead get the third track in the tracks list.  
That's because index getters take priority over name getters, and   
myVideoElement.tracks[2] means the same thing as  myVideoElement.tracks 
["2"] in JavaScript. For this reason, it is a bad idea to provide both  
index getters and name getters when the names may be numeric.

I suggest that we drop the name getter, since the index getter is more  
fundamental. No matter what kind of query you want to do, you can  
alway loop over all the tracks using tracks.length and the tracks  
index getter.

(In addition, my expectation is that for JavaScript video controllers  
that are designed to work with an arbitrary video, rather than one  
specific video, the most likely query is by role. And I expect most  
video controls to use a reusable piece of JavaScript code, not code  
that is hardcoded to one specific video and which therefore knows its  
track names.)

Received on Thursday, 4 March 2010 03:27:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:09 UTC