HTML and CSS Reference
In-Depth Information
The audioTracks attribute is of type AudioTrackList, while the videoTracks property is of
type VideoTrackList. The difference between the audio and video collection interfaces is that
more than one audio track can play at a time, but only one video track can play at any given
time.
WARNING
The audio and video track list functionality is so new in the HTML5 specification that it had been
completely redesigned between the time I finished this chapter and when the tech editors had finished
reviewing it. I expect it to continue to change dramatically after this topic is published.
Both AudioTrackList and VideoTrackList support a property, length , with the number of
tracks for each type, respectively. They both also contain another readonlyproperty, kind , that
contains a reference to the type of track. Table 9 contains a listing of the possible category
values this property may contain (derived from a table given in the HTML5 specification).
Table9.Video and Audio Category Values
Category
Definition
Applies
to…
Example
alternative
A possible alternative to main track
Audio and
Video
Ogg: “audio/alternate” or “video/al-
ternate”
description
An audio description of a video track
Audio only
Ogg: “audio/audiodesc”
main
The primary audio or video track
Audio and
Video
Ogg: “audio/main” or “video/main”
sign
A sign-language interpretation of an au-
dio track
Video only
Ogg: “video/sign”
translation
A translated version of the main track
Audio only
Ogg: “audio/dub”
“” (empty
string)
No explicit kind
Audio and
video
Any role not matching given cat-
egories
The objects also support gettersthat allow application developers to access specific tracks us-
ing an index value:
var specTrack = videoObjTracks(1);
Search WWH ::




Custom Search