Javascript – How to get a more precise current, video and start time with YouTube iframe

iframejavascriptyoutubeyoutube-api

At the moment my start time and end time for an embedded video is put in seconds. However, I know it's possible to be much more precise than this (when I go to my playlists in YouTube, I can edit the start and end times of each video, and YouTube lets me drag the player head around and displays milliseconds – although of course you can't move ms by ms).

My app needs precision, and both getCurrentTime and seekTo only take seconds as arguments. How does YouTube manage to be more precise? A 1/4 second precision would be fine enough for me.

Best Answer

You can specify fractions of seconds using a float number

I think this answer and this example may be useful

Youtube API seekTo() in float seconds