How to I retrieve the length in seconds of a <video> element using Javascript?
I have a <video>
tag with the id of "liveVideo". How do I retrieve the length of t开发者_JAVA技巧he video in seconds?
Thanks,
David!
media.duration
check the spec http://www.w3.org/TR/html5/video.html#offsets-into-the-media-resource
$('#liveVideo').attr('duration') // will return the full length of the movie
精彩评论