I know how to get the current elapsed time of a youtube video using…
player.getCurrentTime()
But I need a way to show this as updating text inside an element so I can display the current time of the youtube video counting while the video is playing. What’s the correct way to do this preferably using jquery?
If the player doesn’t offer a callback when the seconds roll over, you could still poll the current time. Choosing the correct polling frequency is a performance trade-off, but you don’t really need to crank it up:
jQuery does not really simplify the waiting but you can use it for DOM manipulation: