javascript - HTML5 video duration -


here have javascript function:

function displayduration(){ var vdo = document.getelementbyid('v'); document.getelementbyid('dur').innerhtml = vdo.currenttime+" / "+vdo.duration; } 

which can call this: <button onclick='displayduration()'>display duration</button>

but display current time in div, without button right beginning such continues update self dynamically, youtube.

please help!

bind function video's timeupdate event instead of button's click event, or run via setinterval


Comments