Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vimeo froogaloop seekto and play

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/

like image 814
Tom Avatar asked Mar 25 '12 21:03

Tom


3 Answers

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;
  }
});
like image 166
sepans Avatar answered Nov 16 '22 08:11

sepans


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.

like image 2
Juan Mellado Avatar answered Nov 16 '22 10:11

Juan Mellado


I would recommend that it starts playing - then skips ahead to the desired point. See your modified JS Fiddle: http://jsfiddle.net/q6Lxg/5/

like image 1
mikevoermans Avatar answered Nov 16 '22 09:11

mikevoermans