Using html5 audio tags with Ogg media files, how can I using javascript, retrieve how much data has been loaded on the client side (in realtime).
<audio id="warp" preload="auto" controls>
<source src="warp.mp3" type="audio/mp3">
<source src="warp.ogg" type="audio/ogg">
</audio>
<script>
var a = document.getElementById('warp');
var t = a.currentTime;
var d = a.duration;
var z = a.buffered.end(a.buffered.length-1);
</script>
z is the number of seconds of audio that is currently buffered. t is the number of seconds from the beginning of the audio track where the playhead is. d is the total number of seconds of the audio track.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With