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

Duration differences


I am capturing the video duration using jwplayer().getDuration() function. The value i get in return is 119.52. I then convert it into minutes (119.52 / 60) = 1.992. But the video duration on the player is 1:59. This difference varies for different videos.

Similarly i also capture the current seek time using self.currenseektime on pause event. Here also if i pause the video at 71.16 seconds and convert it into minutes i6 (71.16 / 60) = 1.186. But the player shows 1:11 as current time

I need to capture the time displayed by the player. Is there anything basic i am missing in converting the time?

3 Community Answers

Alex

JW Player Support Agent  
1 rated :

Hi there,

The time values you get from various JavaScript API calls for the player are based on seconds. This means that 119.52 seconds is 1.992 minutes which equates to 1:59 (one minute and 59 seconds). Think of it this way – 59 seconds is approximately 0.992 of one minute.

The same thing goes for your other value. 71.16 seconds = 1.186 minutes = 1:11 because 11 seconds is approximately 0.186 of one minute.

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

Thank you!

swanand

User  
0 rated :

Thanks Alex for the explanation. I am able to convert the seconds in a proper way now. :)

Alex

JW Player Support Agent  
0 rated :

Not a problem!

This question has received the maximum number of answers.