I am having trouble skipping to a certain point in a Vimeo video clip and making it play.
I have managed to make it skip using the froogaloop seekto function, but unless the video is already playing, it jumps back to the start again...
Here's an example of my page...
http://jsfiddle.net/q6Lxg/
The problem I have had was that the video had not been loaded properly when the seekTo
was called.
Though adding a setTimeout
delay works most of the time, the more elegant solution is to put seekTo
in the ready callback function:
var pendingSeektoTime = 0;
player.addEvent('ready', function() {
if(pendingSeektoTime!=0) {
player.api('seekTo',pendingSeektoTime);
pendingSeektoTime = 0;
}
});
Documentation says that Flash player version can't start playing after the loaded point:
seekTo(seconds:Number):void
Seeks to the specified point in the video. Will maintain the same playing/paused state. The Flash player will not seek past the loaded point, while the HTML player will seek to that spot regardless of how much of the video has been loaded.
Your example works fine if the loaded point is after the seek point.
I would recommend that it starts playing - then skips ahead to the desired point. See your modified JS Fiddle: http://jsfiddle.net/q6Lxg/5/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With