Open In App

HTML | DOM onwaiting event

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

The onwaiting event in HTML DOM occurs when the video stops for buffer the next frame.

Supported tags:

  • audio
  • video

Syntax:

  • In HTML:
    <element onwaiting="Script">
  • In JavaScript:
    object.onwaiting = function(){Script};
  • In JavaScript, using the addEventListener() method:
    object.addEventListener("waiting", Script);

Example: Using the addEventListener() method




<!DOCTYPE html>
<html>
   
<head>
    <title>HTML DOM onwaiting Event</title>
</head>
   
<body>
    <center>
        <h1 style="color:green">GeeksforGeeks</h1>
        <h2>HTML DOM onwaiting Event</h2>
   
        <video controls id="videoID">
            <source src="GFG.mp4" type="video/mp4">
        </video>
   
    </center>
    <script>
        document.getElementById(
          "videoID").addEventListener("waiting", GFGfun);
   
        function GFGfun() {
            alert("Buffering");
        }
    </script>
   
</body>
   
</html>


Output:

Supported Browsers: The browsers supported by HTML DOM onwaiting event are listed below:

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

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads