HTML <audio> preload Attribute

The preload attribute on an <audio> element specifies if and how the audio file is loaded after the page loads.

Example

#

A preload attribute on an <audio> player.
The preload option is none. The audio file is only loaded when the start button is clicked.

<audio controls preload="none">
  <source src="/media/epic.mp3" type="audio/mpeg">
  <source src="/media/epic.wav" type="audio/wav">
</audio>

Using preload

The <preload attribute specifies if and how the audio file is loaded after the page loads.

This attribute can specify that the audio file is loaded even if the user does not need it.

The preload setting is ignored when autoplay is enabled.


Syntax

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

Values

#

Value Description
auto Loads the entire audio file when the page loads.
metadata Only loads audio metadata when the page loads.
none Does not load the audio file when the page loads.
empty string Assigning no value is the same as the auto setting.

Note:  Without the a preload setting, the file loading is different for each browser. For consistency the metadata setting is often a reasonable option.


Browser support

Here is when preload support started for each browser:

Chrome
4.0 Jan 2010
Firefox
4.0 Mar 2011
IE/Edge
9.0 Mar 2011
Opera
11.5 May 2011
Safari
4.0 Jun 2009

You may also like

 Back to <audio>
Guides