English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
loadstart event is fired when the browser starts to load a resource file.
HTML Audio/Video DOM Reference Manual
Hint: The video has started to load:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Audio/Video onloadstart event usage-Basic Tutorial(oldtoolbag.com)</title> </head> <body> <video id="video1" controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support HTML5 video tag. </video> <script> myVid=document.getElementById("video1"); myVid.onloadstart=alert("Starting to load video"); </script> </body> </html>Test to see ‹/›
When the browser starts to search for the specified audio/video, the loadstart event occurs. This is the time when the loading process begins
In audio/The following events occur in the order listed during the video loading process:
IEFirefoxOperaChromeSafari
All major browsers support the loadstart event.
Note:Internet Explorer 8 and earlier versions do not support this event.
In HTML:
<audio|video onloadstart="SomeJavaScriptCode">
In JavaScript:
audio|video.onloadstart=SomeJavaScriptCode;
Use addEventListener():
audio|video.addEventListener("loadstart", function()
{
//SomeJavaScriptCode
}
);
The following HTML tags support: | <audio>, <video> |
---|---|
The following JavaScript objects support: | Audio, Video |
Use the onloadstart attribute on HTML elements
Use addEventListener() to listen to the loadstart event
HTML Audio/Video DOM Reference Manual