Skip to content
Related Articles

Related Articles

HTML | DOM Audio error Property
  • Last Updated : 30 Nov, 2019

The DOM Audio error property is used to returns MediaError object and MediaError object contains error state of Video.



Return Type:
Numbers: The MediaError Object returns a number representing the error state of the video:

  • 1 = MEDIA_ERR_ABORTED – User aborted fetching process
  • 2 = MEDIA_ERR_NETWORK – error occurred at the time of downloading
  • 3 = MEDIA_ERR_DECODE – error occurred at the time of decoding
  • 4 = MEDIA_ERR_SRC_NOT_SUPPORTED – audio are not supported


<!DOCTYPE html>
        <h1 style="color:green">GeeksforGeeks</h1>
        <h2>DOM Audio error Property</h2>
        <audio id="my_Audio" controls autoplay>
            <source id="mp4_src"
        <button onclick="myAudio()" type="button">
            Click It
            var a = document.getElementById("my_Audio");
            function myAudio() {
                alert("error: " + a.error.code);


  • Before Click on Button:
  • After Click on Button:

Supported Browser: The browsers supported by HTML DOM Audio error property are listed below:

  • Internet Explorer


My Personal Notes arrow_drop_up
Recommended Articles
Page :