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

getDuration() always returns 0


Hello, I need to get total duration of the video. I saw previous ticket with the same question but doesn't look like it was answered in months. I need this functionality. Please help how I can get the total duration, thanks.

2 Community Answers

Todd

JW Player Support Agent  
0 rated :

Depending on the video type and the player configuration, you might not be able to get the correct duration from getDuration() until you call it in an onPlay() event:

.once(‘play’,function(){console.log(jwplayer().getDuration(););})

fernando.is.sanchez Company

User  
0 rated :

Okay thank you.

This question has received the maximum number of answers.