Reputation: 313
This one is a simple question, but I have no experience in this topic, so I would like to use your help. So, the question is (as the title says):
How can I determine the length(duration in sec) of a YouTube video?
It would be great if this information is available from HTML source. But any other idea is good, I'm currently just brainstorming about a new application, where the duration of the videos is strongly important.
Do you have any idea?
Upvotes: 1
Views: 2749
Reputation: 188
You can use javascript youtube api. You can find our more on this link https://developers.google.com/youtube/js_api_reference#Retrieving_video_information
Where you have method on player:
player.getDuration()
Upvotes: 3