Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Seek does not seem to work with HLS


I am constructing a player from a playlist and attempting to seek it to a valid offset, right when it is built. I am trying to go to a set time that was stored and passed in.
This code worked with a previous version of JWPlayer, and now that I have upgraded to 7.10.7, it does not work any longer.
The offset, even after I seek, is always 0.
Here is some example code:
console.log('SEEKING TO ' + offset) // prints SEEKING TO 1618
player.seek(offset);
var position = Math.round(player.getPosition());
console.log(position); // prints 0
if (position != offset){
player.playlistItem(index).seek(offset); // index is 0
position = Math.round(player.getPosition());
console.log(position); // prints 0
}

What is the correct way to seek? This follows the documentation.
Thanks
Tamar

2 Community Answers

Tamar Cohen

User  
0 rated :

I still have not solved this -- stepping into the jwplayer code it looked like it needs to be in play mode before it can seek. I have tried making that change but it still will not seek. I've also put a callback in the onSeek to print out the starting and offset values, and it tends to print undefined and then 0, even if I have asked it to seek a non-zero value.

Alex

JW Player Support Agent  
0 rated :

Hi, there.

Can you please supply a link to a reproduction page so we can take a look at your issue?

Thank you.

This question has received the maximum number of answers.