I am using HTML5 audio tag for playing sound files in my template. For some purpose I need to track the currentTime and duration which shows upto milliseconds. Now I am able to get the values in seconds only. Is there any possible methods? Below is my code:
HTML
<audio controls id="track" src="<path-to-soundtrack>"
ontimeupdate="TrackAudio(this)">
<p>Your browser does not support the audio element</p>
</audio>
JAVASCRIPT
function TrackAudio(element){
var curTime = Math.floor(element.currentTime);
console.log(curTime) //Value in seconds.
}