IMO this should be a feature of TextTrackCue and has no relevance to VTTCue
specifically. There's implementation overloading here that is mixing concerns
On 18 Sep 2016, at 17:46, Melvin Carvalho
On 18 September 2016 at 14:44, Simon Pieters
On Sun, 18 Sep 2016 01:21:27 +0200, Melvin Carvalho <
Apologies if this has come up before, but I was wondering if it would be
possible to add simple parameters to the play() function.
They would be
Where start and end are the times in seconds.
I know you can do
video.currentTime = start ; video.play()
But there's no real easy way to stop it to play a clip
The media fragments URIs spec  handles this quite nicely by adding to
But yet there seems to be no way to do this in JS, resorting to changing
location.hash and then doing a reload, which seems a bit of a kludge
I may be missing something extremely obvious, if so, I'd love to know!
The pauseOnExit attribute on VTTCue can be used for this purpose. See
#text-track-api:the-audio-element for an example.
Thank you for both answers!
I found pauseOnExit to work very well for my use case. I ended up with.
cue = new VTTCue(start, end, '')
cue.pauseOnExit = true
v.currentTime = start
var cue = new VTTCue(start, end, '');
As best I could tell that last parameter is a 'message', tho Im not sure I
got any message when the video stopped, even when I populated it. Maybe I
wasnt supposed to.
I'm quite happy to use this solution. My slight concert is whether there
are any side effects from adding a TextTrack to a video.
Should this be considered best practice, or would there perhaps still be
room in future for (start, end) parameters?