HTML | DOM onwaiting event
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" >w3wiki</ 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
Contact Us