开发者

How to I retrieve the length in seconds of a <video> element using Javascript?

开发者 https://www.devze.com 2023-01-09 04:22 出处:网络
I have a <video> tag with the id of \"liveVideo\". How do I retrieve the length of t开发者_JAVA技巧he video in seconds?

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
0

精彩评论

暂无评论...
验证码 换一张
取 消