videojs-overlay
videojs-overlay copied to clipboard
Clickable overlays which links to a different timing in the video
Hi!
Is it possible to create a clickable overlay so that it would skip to a specified timing in the video?
For eg, the overlay appears at 2s. I click on it and it will jump the video to 10s. Any idea how I can achieve this?
Much appreciated! Thank you!
I did it by giving the link a special class, then put an event on the link with this class. When the event fires, read out the time to skip to and call videojs.currentTime(Time to jump to)
The timeframe to jump to is in the link.
$("a.videoanchor").off("click").on("click", function(e) { e.preventDefault(); timeframe = $(this).attr("href"); videojs.currentTime(timeframe); });