Atributo de pré-carregamento de HTML <audio>

❮ Tag HTML <áudio>

Exemplo

O autor acha que o som NÃO deve ser carregado quando a página for carregada:

<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>

Definição e uso

O preloadatributo especifica se e como o autor pensa que o arquivo de áudio deve ser carregado quando a página for carregada.

O preloadatributo permite que o autor forneça uma dica ao navegador sobre o que ele acha que levará à melhor experiência do usuário. Este atributo pode ser ignorado em alguns casos.

Nota: O atributo preload é ignorado se autoplayestiver presente.


Suporte ao navegador

Os números na tabela especificam a primeira versão do navegador que suporta totalmente o atributo.

Attribute
preload 4.0 9.0 4.0 4.0 11.5

Sintaxe

<audio preload="auto|metadata|none">

Valores de atributo

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 <áudio>