Execute a JavaScript when meta data for an audio is loaded:
<!DOCTYPE html> <html> <body> <audio controls onloadedmetadata="myFunction()"> <source src="sound.ogg" type="audio/ogg"> <source src="sound.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio>// w w w. j ava2 s . c om <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = "Meta data for audio loaded"; } </script> </body> </html>