English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The loadstart event is fired when the browser starts to load a resource file.
Áudio HTML/Manual de Referência DOM de Vídeo
Tip: The video has started to load:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Audio/Use of video onloadstart event-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/When the video occurs, the loadstart event is triggered. This is the time when the loading process starts
In audio/During the loading process of the video, the following events occur in the following order:
IEFirefoxOperaChromeSafari
Todos os navegadores populares suportam o evento loadstart.
Atenção:Internet Explorer 8 e versões anteriores não suportam este evento.
No HTML:
<audio|video onloadstart="SomeJavaScriptCode">
No JavaScript:
audio|video.onloadstart=SomeJavaScriptCode;
Usar addEventListener():
audio|video.addEventListener("loadstart", function()
{
//SomeJavaScriptCode
}
);
Os seguintes tags HTML suportam: | <audio>, <video> |
---|---|
Os seguintes objetos JavaScript suportam: | Áudio, Vídeo |
Usar a propriedade onloadstart em elementos HTML
Usar addEventListener() para ouvir o evento loadstart
Áudio HTML/Manual de Referência DOM de Vídeo