TextTrack.mode property is a string which indicates the text track's mode. You can read this value to determine the current mode, and you can change this value to switch modes.
var mode = TextTrack.mode; TextTrack.mode = "disabled" | "hidden" | "showing";
The text track mode—sometimes identified using the IDL enum
TextTrackMode—must be one of the following values:
TextTrack.cuesproperty). The user agent is keeping a list of the active cues (in the track's
activeCuesproperty) and events are being fired at the corresponding times, even though the text isn't being displayed.
activeCueslist is being maintained and events are firing at the appropriate times; the track's text is also being drawn appropriately based on the styling and the track's
When the mode is
"showing", text tracks are performed differently depending on their
kind. In general:
"captions"are rendered with the cues overlaid over the top of the video.
"descriptions"are presented in a non-visual form (for example, the text might be spoken to describe the action in the video).
"chapters"are used by the user agent or the Web site or Web app to construct and present an interface for navigating the named chapters, where each cue in the list represents a chapter in the media. The user can then navigate to the desired chapter, which begins at the cue's start position and ends at the cue's end position.
|WebVTT: The Web Video Text Tracks Format |
The definition of 'mode' in that specification.
|Feature||Chrome||Edge||Firefox (Gecko)||Internet Explorer||Opera||Safari (WebKit)|
|Feature||Android||Chrome||Firefox Mobile (Gecko)||Firefox OS||IE Phone||Opera Mobile||Safari Mobile|
|Basic support||4.4||18||31||?||No support||No support||7.1|
change event to the element's
TextTrackList for each change, even if mutliple changes are made in a single pass through the Firefox event loop. Starting in Firefox 52, these changes are reflected by a single event.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.