Latest web development tutorials

HTML <audio> preload property

HTML audio tag Reference Manual HTML <audio> tag

Examples

Set preloaded audio element:

<audio controls preload="none">
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
  您的浏览器不支持 audio 元素。
</audio>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

At present, all major browsers support preload property, in addition to Internet Explorer.


Definition and Usage

preload attribute specifies whether to load the audio after the page is loaded.

If the autoplay attribute, this property is ignored.


HTML 4.01 and HTML 5 differences between

preload attribute is HTML 5 new property. <Audio> tag is the new HTML5 tags.


grammar

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

Property Value

value description
load

Specifies whether pre-loaded audio.

Possible values:

  • auto - loaded when the page loads the entire audio
  • meta - When the page is loaded load only the metadata
  • none - When the page is loaded without loading audio


HTML audio tag Reference Manual HTML <audio> tag