Text Tracks JavaScripting
This table lists browser javascripting support for text tracks. We test the following operations:
- Retrieval and updating of track attributes (kind, label, mode, cues).
- Listening to cuechange events and fetching the active cue text.
- Creation of new text tracks and track cues.
| Browser | Track attributes | Cue Changes | Create tracks |
|---|---|---|---|
| Firefox 20 | - | - | - |
| Chrome 26 | yes | yes | yes |
| Safari 6 | yes 1,2 | yes | - 3 |
| Opera 12 | yes | yes | yes |
| Internet Explorer 9 | - | - | - |
| Internet Explorer 10 | yes4 | yes4 | - |
| iOS 6 (iPad 4) | - | - | - |
| Android 4.2 (Nexus 7) | - | - | - |
- Instead of just captions/subtitles, cues of every kind of track are rendered over the video.
- Safari uses integers (0,1,2) instead of strings (disabled,showing,hidden) for track modes.
- Setting a JavaScript generated track to "showing" consistently crashes the browser.
- Server MIME type for text/vtt must be set
See the HTML5 text tracks spec for more information.
Test Setup
This setup contains a video encoded in both WebM and MP4. The video contains four text tracks:
Tracks can be either disabled, hidden or showing. Toggle the mode of a track and see if the list reflects it.
This link adds a text track to the video. It should pop up in the list and contain 7 cues.
Finally, the area to the left shows the active thumbnail cue from the metadata track. Note that cues can only be active if the track is in the hidden or showing mode. Toggle the mode with the link above the video.