English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTML Audio/Video DOM Reference Manual
Wenn die Seite geladen wird, beginnt das Video zu laden:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML-Audio/Verwendung der Video-Preruntime-Eigenschaft-Grundlegende Anleitung(oldtoolbag.com)</title> </head> <body> <button onclick="enablePreload()" type="button">Video laden</button> <button onclick="disablePreload()" type="button">Video nicht laden</button> <button onclick="checkPreload()" type="button">Überprüfen Sie den Ladezustand</button> <br> <video id="video1" controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Ihr Browser unterstützt keine HTML5 video-Tags. </video> <script> myVid=document.getElementById("video1"); function enablePreload() { myVid.preload="auto"; } function disablePreload() { myVid.preload="none"; } function checkPreload() { alert(myVid.preload); } </script> </body> </html>Testen Sie, ob das funktioniert ›/›
The preload attribute sets or returns whether the audio should start loading immediately after the page is loaded/Video.
The preload attribute allows the author to provide the browser with information about him/She believes that it will bring the best user experience tips. In some cases, this attribute can be ignored.
IEFirefoxOperaChromeSafari
All mainstream browsers support the preload attribute.
Note:Internet Explorer 8 and earlier versions do not support this attribute.
Set preload attribute:
audio|video.preload="auto|metadata|none"
Return preload attribute:
audio|video.preload
Value | Description |
---|---|
auto | Indicates that audio should start loading once the page is loaded/Video. |
metadata | Indicates that audio should be loaded only after the page is loaded/Metadata of the video. |
none | Indicates that audio should not be loaded after the page is loaded/Video. |
Return value: | String value, auto|metadata|none |
---|