HTML onwaiting Event Attribute

Description

The event attribute onwaiting occurs when the media file is stopped, but the restart is expected to resume (for example, when the file pauses to buffer the remaining data).

Syntax

<element onwaiting="script">

Values

  • scriptThe name of the script to use when the event has been triggered.

Example

<!DOCTYPE html> 
<html> 
<head> 
    <title>onwaiting Event attribute</title> 
</head> 
   
<body> 
    <center> 
        <h2>onwaiting Event Attribute</h2> 
        <video controls id="videoID"> 
            <source src="sample.mp4" type="video/mp4"> 
        </video> 
    </center> 
<script> 
  document.getElementById("videoID").addEventListener("waiting", testFunction); 
   
function testFunction() { 
   alert("Buffering"); 
} 
</script> 
   
</body> 
</html> 

Supported Tags

<audio> and <video>

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
XXYes3.5XX
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYes4XXX