getAvailableTextTracks
Description
Returns the list of available text tracks (subtitles) for the current content.
Each of the objects in the returned array have the following properties:
-
id
(string
): The id used to identify the track. Use it for setting the track viasetTextTrack
. -
language
(string
): The language the text track is in, as 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-2 language codes). If the translation attempt fails (no corresponding ISO 639-3 language code is found), it will equal the value oflanguage
-
closedCaption
(Boolean
): Whether the track is specially adapted for the hard of hearing or not. -
active
(Boolean
): Whether the track is the one currently active or not.
This method will only return the available tracks of the Period that is currently playing.
Syntax
const textTracks = player.getAvailableTextTracks();
- return value
Array.<Object>