HTML and CSS Reference
In-Depth Information
The developer can also use the getTrackById method (passing in the identifier of the track),
if the media resource supports track identifiers. Other properties for both objects are:
label
Track label if one is provided by the media resource
language
The BCP 47 language tag (such as en for English) for the track
enabled
Whether the track is enabled or not
Both objects support one event, change , triggered when the track selection has changed. In
addition, the VideoTrackList object also supports another property, selected , which is set to
true for the track currently selected; false for other tracks.
Web applications can provide functionality to select audio or video tracks, but this information
can also be defined within the HTML, using syntax such as the following:
<video src="videofile#track=Alternative"></video>
This only works if the media resource provides support for the Media Fragments URI, another
new specification being developed at the W3C.
NOTE
The Media Fragments URI specification can be found at http://www.w3.org/TR/media-frags/ . This
specification is only in draft state, and may change considerably before reaching recommendation
status.
When browsers do provide support for multiple track lists, they'll provide an option in the de-
fault user interface to select from among a list of available audio tracks.
How would the multiple audio track support work? If a video has multiple language transla-
tions, a menu could be provided allowing the user to pick which language he or she prefers.
Users could also be given the option of playing an alternative track, rather than the main
track—similar to playing the extended cut versions in our DVDs and Blu-Rays.
Unfortunately, no browser—released, beta, or otherwise—currently supports the HTMLMe-
diaElement audioTracks or videoTracks properties, or the associated interfaces.
Search WWH ::




Custom Search