Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickable overlays which links to a different timing in the video #44

Open
newtocoding123 opened this issue Jan 25, 2017 · 1 comment
Open

Comments

@newtocoding123
Copy link

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!

@gesmit
Copy link

gesmit commented Jul 14, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants