Видео Метод addTextTrack()
Пример
Добавьте новую текстовую дорожку к видео:
var x = document.getElementById("myVideo");
var y = x.addTextTrack("caption");
y.addCue(new TextTrackCue("Test text", 01.000, 04.000, "", "", "", true));
Определение и использование
Метод addTextTrack() создает и возвращает новый объект TextTrack.
Новый объект TextTrack добавляется в список текстовых дорожек для видеоэлемента.
Поддержка браузера
Method | |||||
---|---|---|---|---|---|
addTextTrack() | Not supported | Not supported | Not supported | Not supported | Not supported |
Синтаксис
videoObject.addTextTrack(kind, label, language)
Значения параметров
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 |
Технические детали
Возвращаемое значение: | Объект TextTrack, представляющий новую текстовую дорожку. |
---|
❮ Видео Объект