Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube player JS API seekTo function not working

I'm trying to use Youtube chromeless player through the JS API and I'm having problems with seekto() function.

The problem is that sometimes (I can't tell when the problem arises), calling seekTo() function backwards to a point in the video that is not loaded don't come back and instead stays in the current time.

This is what I do (imagine the video is 240 seconds length):

  1. I start playing a video -> loadVideoById().
  2. I move forward to (let's say) the middle of the video -> seekTo(120)
  3. Video jumps correctly to the position I asked.
  4. I try to move backwards to 25% time of the video -> seekTo(60)
  5. Sometimes the video jumps back to 60 but more often it only goes back to 120.

So, is anyone else having this issue?

like image 687
PaquitoSoft Avatar asked Mar 31 '12 12:03

PaquitoSoft


1 Answers

Posting some code will help us to help you, but have you tried player.seekTo(60, true); - the second parameter is important - setting it to true will make the player send a new request to the server for the video.

like image 118
Jimmery Avatar answered Oct 18 '22 14:10

Jimmery