Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html> 
<html> 
<body> 
<audio id="myAudio" controls>
  <source src="mov_broken.ogg" type="audio/ogg">
  <source src="mov_broken.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>
<p>Click the button to get the error state of the audio.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
  let x = document.getElementById("myAudio").error.code;
  document.getElementById("demo").innerHTML = x;
}
</script> 
</body> 
</html>