Open In App

HTML | DOM onstalled Event

Last Updated : 27 Aug, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

The onstalled event in HTML DOM occurs when media data get by the browser but the data is not available.

Syntax:

  • In HTML:
    <element onstalled="myScript">
  • In JavaScript:
    object.onstalled = function(){myScript};
  • In JavaScript, using the addEventListener() method:
    object.addEventListener("stalled", myScript); 

Supported tag:

  • <audio>
  • <video>

Example: Using the addEventListener() method




<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML DOM onseeked Event
    </title>
</head>
  
<body>
    <center>
        <h1 style="color:green">GeeksforGeeks</h1>
        <h2>HTML DOM onseeked Event</h2>
  
        <video controls id="videoID">
            <source src=
                    type="video/mp4">
        </video>
    </center>
    <script>
        document.getElementById(
            "videoID").addEventListener("stalled", GFGfun);
  
        function GFGfun() {
            alert(
              "Data of this media not available");
        }
    </script>
  
</body>
  
</html>


Supported Browsers: The browsers supported by HTML DOM onstalled Event are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads