Video addTextTrack() methode
Voorbeeld
Voeg een nieuwe teksttrack toe aan de video:
var x = document.getElementById("myVideo");
var y = x.addTextTrack("caption");
y.addCue(new TextTrackCue("Test text", 01.000, 04.000, "", "", "", true));
Definitie en gebruik
De methode addTextTrack() maakt en retourneert een nieuw TextTrack-object.
Het nieuwe TextTrack-object wordt toegevoegd aan de lijst met teksttracks voor het video-element.
Browserondersteuning
Method | |||||
---|---|---|---|---|---|
addTextTrack() | Not supported | Not supported | Not supported | Not supported | Not supported |
Syntaxis
videoObject.addTextTrack(kind, label, language)
Parameterwaarden
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 |
Technische details
Winstwaarde: | Een TextTrack-object, dat het nieuwe tekstspoor vertegenwoordigt |
---|
❮Video-object