audio preload Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:audio

Description

The preload attribute specifies if the audio file should be loaded when the page loads.

The preload attribute is ignored if autoplay is present.

Attribute Values

ValueDescription
auto the browser should load the entire audio file when the page loads
metadata the browser should load only metadata when the page loads
none the browser should NOT load the audio file when the page loads

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<audio controls preload="none">
  <source src="your.ogg" type="audio/ogg">
  <source src="your.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio><!--from  ww  w .  j  a v  a  2 s  .  c o  m-->

</body>
</html>

Related Tutorials