Méthode vidéo addTextTrack()
Exemple
Ajoutez une nouvelle piste de texte à la vidéo :
var x = document.getElementById("myVideo");
var y = x.addTextTrack("caption");
y.addCue(new TextTrackCue("Test text", 01.000, 04.000, "", "", "", true));
Définition et utilisation
La méthode addTextTrack() crée et renvoie un nouvel objet TextTrack.
Le nouvel objet TextTrack est ajouté à la liste des pistes de texte pour l'élément vidéo.
Prise en charge du navigateur
Method | |||||
---|---|---|---|---|---|
addTextTrack() | Not supported | Not supported | Not supported | Not supported | Not supported |
Syntaxe
videoObject.addTextTrack(kind, label, language)
Valeurs des paramètres
Value | Description |
---|---|
kind | Specifies the kind of text track. Possible values:
|
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 |
Détails techniques
Valeur de retour : | Un objet TextTrack, représentant la nouvelle piste de texte |
---|
❮ Objet vidéo