- From: Simon Pieters <simonp@opera.com>
- Date: Mon, 19 Sep 2016 16:41:32 +0200
- To: "Melvin Carvalho" <melvincarvalho@gmail.com>
- Cc: whatwg@lists.whatwg.org
On Sun, 18 Sep 2016 18:45:51 +0200, Melvin Carvalho
<melvincarvalho@gmail.com> wrote:
>> The pauseOnExit attribute on VTTCue can be used for this purpose. See
>> https://html.spec.whatwg.org/multipage/embedded-content.html
>> #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.
>
> v.addTextTrack('metadata')
> cue = new VTTCue(start, end, '')
> cue.pauseOnExit = true
> cues.addCue(cue)
> v.currentTime = start
> v.play()
>
> Regarding
>
> 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.
It's not a message, it's the cue's text. For a metadata track, you can use
it for anything you want, and access it with `cue.text`. For caption or
subtitle tracks, it's text that gets rendered on top of the video.
> 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?
There is always room for adding convenience APIs, it's a matter of
demonstrating that it's a common enough need to make it worth the cost of
adding it.
https://wiki.whatwg.org/wiki/FAQ#Where.27s_the_harm_in_adding.E2.80.94
HTH,
--
Simon Pieters
Opera Software
Received on Monday, 19 September 2016 15:42:05 UTC