Attributo di precaricamento HTML <audio>
Esempio
L'autore pensa che il suono NON debba essere caricato quando la pagina viene caricata:
<audio controls preload="none">
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Definizione e utilizzo
L' preload
attributo specifica se e come l'autore ritiene che il file audio 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'attributo di precaricamento viene ignorato se autoplay
è presente.
Supporto del browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente l'attributo.
Attribute | |||||
---|---|---|---|---|---|
preload | 4.0 | 9.0 | 4.0 | 4.0 | 11.5 |
Sintassi
<audio preload="auto|metadata|none">
Valori di attributo
Value | Description |
---|---|
auto | The author thinks that the browser should load the entire audio file 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 audio file when the page loads |
❮ Tag HTML <audio>