HTML Audio / Video DOM addTextTrack () method
HTML Audio / Video DOM Reference
Examples
Adding a new text to the video track:
text1=myVid.addTextTrack("caption");
text1.addCue(new TextTrackCue("Test text", 01.000, 04.000,"","","",true));
text1.addCue(new TextTrackCue("Test text", 01.000, 04.000,"","","",true));
try it"
Definition and Usage
addTextTrack () method creates and returns a new TextTrack object.
TextTrack new object is added to the video / audio (audio / video) elements in text track list.
Browser Support
All major browsers do not support addTextTrack () method.
grammar
audio|video .addTextTrack( kind , label , language )
parameter
值 | 描述 |
---|---|
kind | 规定文本轨道的类型。 可能的值:
|
label | 字符串值,为文本轨道规定标签。用于为用户对文本轨道进行标识。 |
language | 双字母语言代码,规定文本轨道的语言。 如需查看所有可用的语言代码,请参阅我们的 语言代码参考手册 。 |
return value
类型 | 描述 |
---|---|
TextTrack 对象 | 表示新的文本轨道。 |
HTML Audio / Video DOM Reference