Attributo di precaricamento HTML <video>
Esempio
L'autore pensa che il video NON debba essere caricato durante il caricamento della pagina:
<video controls preload="none">
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
Definizione e utilizzo
L' preload
attributo specifica se e come l'autore pensa che il video debba essere caricato al caricamento della pagina.
L' preload
attributo consente all'autore di fornire un suggerimento al browser su ciò che secondo lui porterà alla migliore esperienza utente. Questo attributo può essere ignorato in alcuni casi.
Nota: l' preload
attributo viene ignorato se
autoplay
è presente.
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente l'attributo.
Attribute | |||||
---|---|---|---|---|---|
preload | 4.0 | 9.0 | 4.0 | 3.1 | 10.5 |
Sintassi
<video preload="auto|metadata|none">
Valori di attributo
Value | Description |
---|---|
auto | The author thinks that the browser should load the entire video when the page loads |
metadata | The author thinks that the browser should load only metadata when the page loads |
none | The author thinks that the browser should NOT load the video when the page loads |
❮ Tag HTML <video>