HTML and CSS Reference
In-Depth Information
The kind and srclang attributes are equivalent to the TextTrack object's kind and language
properties, discussed in the last section. The language attribute takes a BCP 47 language des-
ignation, such as en for English.
The proper formation of the language tag is far beyond the scope of this topic. In the examples, I
use en for English, since I primarily work with English language materials. For more on the lan-
guage tag, I recommend an article from the W3C, “Language tags in HTML and XHTML”, at ht-
tp:// .
The kind attribute can be one of the following values:
▪ subtitles
▪ captions
▪ descriptions
▪ chapters
▪ metadata
To add a new text track to the media element, just add the track element, providing the in-
formation describing the text file. If you add more than one track element, add the default
attribute to only one track element.
Folks speak of subtitles and captions interchangeably, but they aren't the same thing.
A subtitle is a way of providing a textual translation of speech in a video. For instance, many of us
have watched various Godzilla movies in Japanese but with English subtitles.
The use of captions, or more properly, closedcaptioning, not only provides a textual description
of what's being said, but also a textual description of other sounds that are important for the video
watcher to understand what's happening. Text can include cues about a doorbell ringing, a faraway
scream of terror, or even off-screen laughter—any additional information that ensures those who can't
hear the audio can still appreciate the video.
Track File Formats
There is no preferred format for the track files. An existing format for captions and subtitles
embedded in video is the SubRip file format, given a .srtextension. Earlier work on providing
Search WWH ::

Custom Search