Search code examples
javascriptjwplayerseekjwplayer7

jwplayer seek not working after the jwplayer update (version 7.6)


I am using latest jwplayer version (7.6). After the update seek function is not working. This is my code

jwplayer('player').setup ({
    'file': video_url,
    'provider': 'video',
    'width': '640',
    'height': '420',
    'image': image_url,
    'autostart': false,
    'primary': 'flash'
}).seek(300);

I tried jwplayer beforePlay() function instead of seek but it doesn't made any change.

How can I achieve this..?


Solution

  • Your code example would be trying to have the player seek before its even fully setup and playlist is loaded. The best thing to do would have it seek as soon as the .on('firstFrame') event is fired, like this:

    jwplayer('player').on('firstFrame', function() {
      jwplayer('player').seek(300);
    });