W3cubDocs

/DOM

VTTCue.constructor

The VTTCue() constructor returns a new VTTCue object.

Syntax

 vttCue = new VTTCue(startTime, endTime, text);

Parameters

startTime
This is a double representing the time in the video that the cue will start being shown.
endTime
This is a double representing the time in the video that the cue will stop being shown.
text
This is a DOMString representing the text that will be shown.

Example

// 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');

Specifications

Browser compatibilityUpdate compatibility data on GitHub

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