Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: improved formatting and wording of text

It is possible to set a standard subtitle through the API. Viewers of the respective video will then automatically see the

...

subtitles without the need to activate it by themselves.

...


Panel
borderColor#f2f2f2
bgColor#f2f2f2

Get

...

Text Track

...

Determine which subtitles are available for a video. A list of all available subtitles

...

are returned.

...

Code Block

...

language

...

text

...

player.

...

getTextTrack();

 

Sample

...

Response:

Code Block

...

language

...

text
[Object, Object]
    0: Object
        id: "0"
        label: "Ti?ng Vi?t"
        language: "vi"
        proto: Object
    1: Object
        id: "1"
        label: "English"
        language: "en"
        proto: Object
    length: 2
    proto: Array(0)

...



Panel
borderColor#f2f2f2
bgColor#f2f2f2

Set Text Track

Set a standard subtitle track by specifying the track ID. This must be chosen from the available tracks (returned from the "getTextTrack" function above).

Code Block
languagetext
player

 

 

Set subtitle

...

bgColor#DCDCDC

...

.setTextTrack(trackId);
ParameterData TypeDescription
trackIdstringID of the subtitle track that you want to set as standard.

...

 

 

...



Panel
borderColor#f2f2f2
bgColor#f2f2f2

Disable Text Track

Disables the standard subtitle that

...

was previously set. 

...

Code Block

...

language

...

text

...

player.disableTextTrack

...

 

 

...

();