HTML Audio/Video DOM método addTextTrack()

❮ Referencia de DOM de audio/vídeo HTML

Ejemplo

Agregue una nueva pista de texto al video:

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

Definición y uso

El método addTextTrack() crea y devuelve un nuevo objeto TextTrack.

El nuevo objeto TextTrack se agrega a la lista de pistas de texto para el elemento de audio/video.


Compatibilidad con navegador

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

Sintaxis

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

Valores paramétricos

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

Detalles técnicos

Valor devuelto: Un objeto TextTrack, que representa la nueva pista de texto

❮ Referencia de DOM de audio/vídeo HTML