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

Obtaining duration before playback

I saw some older articles referring to this, but I couldn't find anything that works.

I am trying to obtain the duration of the video prior to playback, which I would then send to the database.
Is it because the new version? (I have a paid version 7.0.0)

I tried using this:

onReady: function() {;
duration = this.getDuration();

but it never pauses.

I also tried "autostart:true" and then calling "this.pause()" in onReady, but that also doesn't work.

Here's a link:

1 Community Answers


JW Player Support Agent  
0 rated :

Hi, there!

You should be able to do this with JWPlayer 7 using one of the following:

jwplayer().play() and jwplayer().pause() and playerInstance.pause() [this assumes your DIV id remains ‘playerInstance’]

You can read more about the playback setter and getters in our JavaScript API at

Please let me know if you need any more help or have any other questions.

Thank you!

This question has received the maximum number of answers.