Método HTML de áudio/vídeo DOM addTextTrack()

❮ Referência HTML de áudio/vídeo DOM

Exemplo

Adicione uma nova faixa de texto ao vídeo:

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

Definição e uso

O método addTextTrack() cria e retorna um novo objeto TextTrack.

O novo objeto TextTrack é adicionado à lista de faixas de texto para o elemento de áudio/vídeo.


Suporte ao navegador

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

Sintaxe

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

Valores de parâmetro

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

Detalhes técnicos

Valor de retorno: Um objeto TextTrack, que representa a nova faixa de texto

❮ Referência HTML de áudio/vídeo DOM