HTML Oudio/Video DOM addTextTrack() Metode

❮ HTML oudio/video DOM-verwysing

Voorbeeld

Voeg 'n nuwe tekssnit by die video:

var text1 = myVid.addTextTrack("caption");
text1.addCue(new TextTrackCue("Test text", 01.000, 04.000, "", "", "", true));

Definisie en gebruik

Die addTextTrack() metode skep en gee 'n nuwe TextTrack-objek terug.

Die nuwe TextTrack-voorwerp word by die lys tekssnitte vir die oudio/video-element gevoeg.


Blaaierondersteuning

Method
addTextTrack() Not supported Not supported Not supported Not supported Not supported

Sintaksis

audio|video.addTextTrack(kind,label,language)

Parameterwaardes

Value Description
kind Specifies the kind of text track.

Possible values:

  • "subtitles"
  • "caption"
  • "descriptions"
  • "chapters"
  •  "metadata"
label A string specifying the label for the text track. Is used to identify the text track for the users
language A two-letter language code that specifies the language of the text track.
To view all available language codes, go to our Language code reference

Tegniese besonderhede

Terugkeerwaarde: 'n TextTrack Object, wat die nuwe teksbaan verteenwoordig

❮ HTML oudio/video DOM-verwysing