videojs-overlay icon indicating copy to clipboard operation
videojs-overlay copied to clipboard

Clickable overlays which links to a different timing in the video

Open newtocoding123 opened this issue 8 years ago • 1 comments

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!

newtocoding123 avatar Jan 25 '17 11:01 newtocoding123

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); });

gesmit avatar Jul 14 '17 06:07 gesmit