getTextTrack
Description
Get information about the text track currently set.
null
if no audio track is enabled right now.
If a text track is set and information about it is known, this method will return an object with the following properties:
-
id
(Number|string
): The id used to identify this track. No other text track for the same Period will have the sameid
.This can be useful when setting the track through the
setTextTrack
method. -
language
(string
): The language the text trac./…/Basic_Methods/loadVideo.md#transport set in the Manifest. -
normalized
(string
): An attempt to translate thelanguage
property into an ISO 639-3 language code (for now only support translations from ISO 639-1 and ISO 639-3 language codes). If the translation attempt fails (no corresponding ISO./…/Basic_Methods/loadVideo.md#transport found), it will equal the value oflanguage
-
closedCaption
(Boolean
): Whether the track is specially adapted for the hard of hearing or not.
undefined
if no text content has been loaded yet or if its information is
unknown.
This method will only return the chosen video track for the Period that is currently playing.
Syntax
const textTrack = player.getTextTrack();
- return value
Object|null|undefined