Search completed in 1.17 seconds.
2 results for "addCue":
TextTrack - Web APIs
texttrack.addcue() adds a cue (specified as a texttrackcue object to the track's list of cues.
VTTCue - Web APIs
WebAPIVTTCue"></video> css video { width: 320px; height: 180px; } javascript let video = document.queryselector('video'); video.addeventlistener('loadedmetadata', () => { const track = video.addtexttrack("captions", "简体中文subtitles", "zh_cn"); track.mode = "showing"; const cuecn = new vttcue(0, 2.500, '字幕会在0至2.5秒间显示'); track.addcue(cuecn); const cueen = new vttcue(2.6, 4, 'subtitles will display between 2.6 and 4 seconds'); track.addcue(cueen); }); result chrome: please open in jsfiddle to view the live sample.