English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTML Audio/Verwendung des video DOM addTextTrack() Methods, Online-Beispiel, wie man HTML Audio verwendet/Detaillierte Informationen zum video DOM addTextTrack() Method, Kompatibilität der Browser, Syntaxdefinition und seine Attributwerte.
HTML Audio/Video DOM Reference Manual
Eine neue Textspur zum Video hinzufügen:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Audio/Verwendung des addTextTrack() Methods-Grundlegende Anleitung(oldtoolbag.com)</<title> </<head> <body> <button onclick="addNewTextTrack()" type="button">Einen neuen Textspur hinzufügen: </button> <br> <video id="video1" controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Ihre Browser unterstützt keine HTML5 video-Tag. </video> <script> myVid=document.getElementById("video1); function addNewTextTrack() { text1=myVid.addTextTrack("caption"); text1.addCue(new TextTrackCue("Testtext", 01.000, 04.000,"","","",true)); } </script> </body> </html>Testen Sie es heraus ‹/›
The addTextTrack() method creates and returns a new TextTrack object.
A new TextTrack object will be added to the audio/in the list of text tracks of the video element.
IEFirefoxOperaChromeSafari
All mainstream browsers do not support the addTextTrack() method.
audio|video.addTextTrack(kind,label,language)
Values | Description |
---|---|
kind | Specifies the type of the text track. Possible values:
|
label | String value, specifying the label for the text track. Used to identify the text track for the user. |
language | two-letter language codes, specifying the language of the text track. For a complete list of available language codes, please refer to our Language Code Reference Manual. |
Type | Description |
---|---|
TextTrack Object | Represents a new text track. |