The VTTCue()
constructor returns a new VTTCue
object.
vttCue = new VTTCue(startTime, endTime, text);
double
representing the time in the video that the cue will start being shown.double
representing the time in the video that the cue will stop being shown.DOMString
representing the text that will be shown.// Create a cue that is shown from 2 to 3 seconds and uses the given text. var cue = new VTTCue(2, 3, 'Cool text to be displayed');
Specification | Status | Comment |
---|---|---|
WebVTT: The Web Video Text Tracks Format The definition of 'VTTCue()' in that specification. | Candidate Recommendation |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | ? | Yes | ? | Yes | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | ? | Yes | ? | Yes | Yes | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/VTTCue/VTTCue