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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -