javascript - How to get HTML5 audio duration time when the audio is paused -
i new on html5, want audio duration time when click pause button
here code
<audio controls="" id="audio"> <source src="assets/record_file/abc.mp3" type="audio/ogg"> <source src="assets/record_file/abc.mp3" type="audio/mpeg"> browser not support audio element. please try other latest browser </audio>
any idea how ?
thanks
document.getelementbyid('audio').pause = function() { var currenttime = document.getelementbyid('audio').currenttime; var duration = document.getelementbyid('audio').duration; alert(currenttime); };
please check html audio , video dom reference, describe methods, properties , events.
Comments
Post a Comment