HTML DOM Audio addTextTrack() Method
HTML DOM Audio addTextTrack() Method
-- Learning not just technology, but dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
JavaScript Reference
JavaScript Objects
- JavaScript Array Object
- JavaScript Boolean Object
- JavaScript Date Object
- JavaScript Math Object
- JavaScript Number Object
- JavaScript String Object
- JavaScript RegExp Object
- JavaScript Global Properties/Functions
- JavaScript Operators
- JavaScript Error
Browser Objects
DOM Objects
- HTML DOM Document Object
- HTML DOM Element Object
- HTML DOM Attribute Object
- HTML DOM Event Object
- HTML DOM Console Object
- CSSStyleDeclaration Object
- DOM HTMLCollection
HTML Objects
- <a>
- <area>
- <audio>
- <base>
- <blockquote>
- <body>
- <button>
- <canvas>
- <col>
- <colgroup>
- <datalist>
- <del>
- <details>
- <dialog>
- <embed>
- <fieldset>
- <form>
- <iframe>
- <frameset >
- <img>
- <ins>
- <input> - button
- <input> - checkbox
- <input> - color
- <input> - date
- <input> - datetime
- <input> - datetime-local
- <input> - email
- <input> - file
- <input> - hidden
- <input> - image
- <input> - month
- <input> - number
- <input> - range
- <input> - password
- <input> - radio
- <input> - reset
- <input> - search
- <input> - submit
- <input> - text
- <input> - time
- <input> - url
- <input> - week
- <keygen>
- <link>
- <label>
- <legend>
- <li>
- <map>
- <menu>
- <menuItem>
- <meta>
- <meter>
- <object>
- <ol>
- <optgroup>
- <option>
- <param>
- <progress>
- <q>
- <script>
- <select>
- <source>
- <style>
- <table>
- <td>
- <th>
- <tr>
- <textarea>
- <title>
- <time>
- <track>
- <video>
Explore Further
- Programming
- Web Services
- Scripting
- Programming Languages
- Scripting Languages
- Web Service
- Computer Science
- Software
- Development Tools
- Web Design and Development
Audio addTextTrack() Method
Example
Add a new text track to an audio element:
var x = document.getElementById("myAudio");
var y = x.addTextTrack("caption");
y.addCue(new TextTrackCue("Test text", 01.000, 04.000,"","","",true));
Definition and Usage
The addTextTrack() method is used to create and return a new text track.
The new TextTrack object is added to the audio element's list of text tracks.
Browser Support
Currently, all major browsers do not support the addTextTrack() method.
Syntax
audioObject.addTextTrack(kind,label,language)
Parameter Values
| Value | Description |
|---|---|
| kind | Specifies the type of text track. Possible values: * "subtitles" * "caption" * "descriptions" * "chapters" * "metadata" |
| label | A string value that specifies the label for the text track. Used to identify the text track for the user. |
| language | A two-letter language code that specifies the language of the text track. To view all available language codes, please refer to our Language Code Reference. |
Technical Details
| Return Value: | A TextTrack object representing the new text track. |
|---|
YouTip