-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Skip to a certain timecode? #1109
Comments
Sure. Just call |
Thanks! Where do I place it in the js video code? |
Assuming your video has an ID of 'vid1' and you want the video to start at 15 seconds in: var video = document.querySelector('#vid1');
video.player.on('play', function() {
this.currentTime(15);
}); Edit by @mmcc: added formatting for readability. |
Thanks! That worked! Just two things. Is it possible to get a similar effect for the flash fallback? I use fancybox (a lightbox plugin) and it only works the first time I click play, if I load the movie again it starts from 0, even though I'm fetching it with ajax everytime and the js code is reloaded with the ajax part. I have to reload the whole page for it to work again. Any ideas how to solve this? Thanks! |
No problem! Can you share the link or do a jsfiddle? |
Unfortunately not. It's on a local server. Is my disposeVideo function screwing it up? This is my code (how do I make code tags here, stuff is not showing?): <video id="player' . $mediaid . '" class="video-js vjs-default-skin vjs-big-play-centered" |
flash is very finicky about being in a lightbox. There's some discussion about it in another issue (don't remember which off the top of my head, @mmcc might know). |
Yeah, it works though, and especially since I implemented the disposeVideo function. |
@seabasss I could be wrong, but I think what's going on is that when you close the lightbox, you destroy the element where you've set the currentTime setting for. |
@seabasss oops, I just read that you load that the video via ajax on lightbox open... Do you create that video DOM element when you create the lightbox as well? |
But I have to otherwise the video js is ticking in the background until forever and I get an error in firebug. And when I reload the video or load another one in fancybox I load the js code again so it should be recreated. Sorry I'm not good at this, I don't know if I create it again. What I do know is that the video tag and the video js is in a separate file that I load via fancybox/ajax so everytime I click on a thumbnail on my page fancybox loads both the video tag and the video js. And the fancybox code is in an external js file. Is there anything else I have to destroy or recreate? Thanks! |
Hello,
and the link : I just copyed it after using video.js and... it doesn't work. |
Hi, it's possible to read the timecode from video? |
Hi!
Is it possible to start the movie from a certain timecode when hitting the play button in video js?
Thanks!
The text was updated successfully, but these errors were encountered: