HTML DOM onloadeddata Event
Last Updated :
20 Jun, 2023
The DOM onloadeddata event in HTML occurs when the current frame data is loaded but the next frame’s data is not enough data to play the audio/video. Events that occur during the loading process of an audio/video:
- onloadstart
- ondurationchange
- onloadedmetadata
- onloadeddata
- onprogress
- oncanplay
- oncanplaythrough
Supported HTML tags:
Syntax:
<element onloadeddata="myScript">
object.onloadeddata = function(){myScript};
- In JavaScript, using the addEventListener() method:
object.addEventListener("loadeddata", myScript);
Example: In JavaScript, using the addEventListener() method
HTML
<!DOCTYPE html>
< html >
< head >
< title >
HTML DOM onloadeddata Event
</ title >
</ head >
< body >
< h1 style = "color:green" >
GeeksforGeeks
</ h1 >
< h2 >
HTML DOM onloadeddata Event
</ h2 >
< video controls id = "VideoId" >
< source src =
type = "video/mp4" >
</ video >
< script >
document.getElementById(
"VideoId").addEventListener(
"loadeddata", GFGFun);
function GFGFun() {
alert("Browser has loaded the current frame");
}
</ script >
</ body >
</ html >
|
Output:
Supported Browsers: The browsers supported by HTML DOM onloadeddata Event are listed below:
- Google Chrome 3
- Edge 12
- Internet Explorer 9
- Firefox 3.5
- Apple Safari 3.1
- Opera 10.5
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...