Reputation: 11
I was able to alert the position of the video by using the jwplayer().getPosition() function but I get something like 3.6064999999999996 but the timer on the video showed me 03:36. How can I exactly get the position as 03:36 instead of 3.6064999999999996?
Screenshot: https://i.sstatic.net/vRfwx.png
Any help is appreciated.
Upvotes: 0
Views: 1006
Reputation: 88428
Taking the fractional part and multiplying by 6 will give you the number of seconds.
Examples: 0.5 * 6 = 30, 0.6 * 6 = 36
Upvotes: 2