var audio = document.getElementById("audio-player");
audio.addEventListener("timeupdate", function() {
var duration = document.getElementById('duration');
var s = parseInt(audio.currentTime % 60);
var m = parseInt((audio.currentTime / 60) % 60);
duration.innerHTML = m + '.' + s + 'sec';
}, false);
|