HTML and CSS Reference
In-Depth Information
I.2. Media text tracks: providing media subtitles and captioning
Grabbing webcam and microphone input isn't the only experimental feature in the works
for HTML5 media; another potentially very useful feature is text tracks. The central feature
of text tracks is to provide subtitles and captioning for hearing-impaired users. All that boils
down to is a file format for describing bits of information associated with time spans and a
means of presenting that information within the browser. With an API, this sort of structure
could be useful in all sorts of ways if you want things to happen in your pages at certain
times during playback of media. For example, if your page contained both a video of a
presentation and a widget showing the slides from the presentation, then you might want
the slideshow widget to automatically switch to the next slide in time with the video.
Fortunately, HTML5 provides such an API. In this section you're going to learn how to use
text tracks and the Text Track API by adding subtitles to one of the videos used in chapter
8 . Figures I.2 and I.3 show the basic idea: subtitles overlaid on the video corresponding to
the current action.
Figure I.2. On the playing video, the caption reads “PASS.”
 
Search WWH ::




Custom Search