5

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/

Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
Tom
  • 12,776
  • 48
  • 145
  • 240

3 Answers3

4

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;
  }
});
sepans
  • 1,372
  • 13
  • 24
2

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.

Community
  • 1
  • 1
Juan Mellado
  • 14,973
  • 5
  • 47
  • 54
1

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

mikevoermans
  • 3,967
  • 22
  • 27