HTML preload Attribute

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 3 Examples
Media & Video

Introduction

The preload attribute on <audio> and <video> tells the browser how much media to fetch before play. Values are none, metadata, and auto. Use preload="none" to save bandwidth on pages with many embeds; use metadata for duration without full download; use auto when instant playback matters. This is not the same as <link rel="preload"> in the document head — that is a separate resource-hint feature. Pair preload with poster on video for a lightweight idle state.

What You’ll Learn

01

Buffer hint

Before play.

02

none

Save data.

03

metadata

Duration only.

04

auto

Full buffer.

05

audio/video

Only elements.

06

.preload

JS property.

Purpose of preload Attribute

Media files can be large. Without a preload hint, browsers make their own choices about buffering — which may waste mobile data on pages where users never press play. The preload attribute lets you declare your intent: fetch nothing, fetch only metadata, or allow full pre-buffering.

This improves performance tuning on blogs with embedded podcasts, course pages with optional clips, and landing pages with hero videos. Browsers treat the value as a hint — they may adjust based on connection speed, data-saver mode, or user settings.

💡
Not the same as rel="preload"

<link rel="preload" href="…" as="font"> fetches fonts, scripts, or images early. The preload attribute on audio/video controls media buffering only.

📝 Syntax

Add preload with one of three keyword values on audio or video:

preload.html
<video controls width="320" preload="metadata">
  <source src="/video/count.mp4" type="video/mp4">
</video>

<audio controls preload="none">
  <source src="/audio/count.mp3" type="audio/mpeg">
</audio>

Syntax Rules

  • Valid values: none, metadata, auto.
  • Omitting the attribute or using an empty value defaults to auto per HTML spec.
  • Valid only on <audio> and <video>.
  • Hint only — browsers may override based on network or data-saver settings.
  • JavaScript: media.preload = "metadata" on HTMLMediaElement.
  • Combine with poster on video when using preload="none".
  • Autoplay may cause buffering regardless of preload="none".

💎 Values

The preload attribute accepts one of three enumerated values:

  • preload="none" — Browser should not preload media data. Best for saving bandwidth.
  • preload="metadata" — Fetch duration, dimensions, and track info only.
  • preload="auto" — Browser may buffer the entire file (default behavior).
preload-values.html
<!-- Lightest — no media bytes until play -->
<video preload="none" poster="/images/apple.png" controls></video>

<!-- Middle — duration without full download -->
<audio preload="metadata" controls></audio>

<!-- Heaviest — ready for instant play -->
<video preload="auto" controls></video>

⚡ Quick Reference

ValueWhat loadsBest for
noneNothing until playMany embeds, mobile data
metadataDuration, size, tracksShow progress bar length early
autoFull media (hint)Hero videos, podcasts
media.preloadJS read/writeDynamic players
Default (omitted)Treated as autoSpec default
With posterThumbnail + no bufferLightweight video cards

Applicable Elements

ElementSupported?Notes
<video>YesPrimary use case
<audio>YesPodcasts, music players
<source>NoSet preload on parent media element
<link>NoUse rel="preload" instead (different feature)
<img>NoImages load via src

preload vs poster vs rel="preload"

FeatureElementPurpose
preload attributeaudio, videoHow much media to buffer before play
poster attributevideoThumbnail image before play
rel="preload"link in headEarly fetch of fonts, CSS, JS, images
autoplayaudio, videoStart playback automatically

Examples Gallery

Compare preload values on audio, set media.preload in JavaScript, and pair preload="none" with poster on video.

👀 Live Preview

Audio with preload="metadata" — duration loads without full download:

Waiting for metadata…

Example — none, metadata, and auto

Three preload strategies on the same audio file:

preload-values-audio.html
<audio controls preload="none">
  <source src="/audio/count.mp3" type="audio/mpeg">
</audio>

<audio controls preload="metadata">
  <source src="/audio/count.mp3" type="audio/mpeg">
</audio>

<audio controls preload="auto">
  <source src="/audio/count.mp3" type="audio/mpeg">
</audio>
Try It Yourself

How It Works

Each value changes how aggressively the browser fetches media bytes on page load. Use DevTools Network tab to compare download size before pressing play.

Dynamic Values with JavaScript

Set preload on a media element before the user interacts:

dynamic-preload.html
<video id="myVideo" controls width="320">
  <source src="/video/count.mp4" type="video/mp4">
</video>

<script>
  document.getElementById("myVideo").preload = "metadata";
</script>
Try It Yourself

How It Works

HTMLMediaElement.preload accepts "", none, metadata, or auto. Useful when building players that adapt to connection quality.

Example — preload="none" with poster

Lightweight video embed: thumbnail visible, no media download until play:

preload-none-poster.html
<video
  controls
  width="320"
  preload="none"
  poster="/images/apple.png">
  <source src="/video/count.mp4" type="video/mp4">
</video>
Try It Yourself

How It Works

poster supplies the visual preview; preload="none" avoids downloading the MP4 until the user presses play. A common pattern for article embeds and mobile-friendly pages.

♿ Accessibility

  • Preload does not affect captions — Use <track kind="captions"> for accessible spoken content regardless of preload value.
  • User data preferencespreload="none" respects users on limited data plans who may never play media.
  • Don’t autoplay unmuted — Autoplay forces loading and can surprise users; pair with muted if required.
  • Provide context — Describe what the audio or video contains in nearby text, not only in the media file.
  • Keyboard access — Use controls or custom accessible controls so users can start playback.

🧠 How preload Works

1

Page loads

Media element.

Parse
2

Read preload

none/metadata/auto.

Hint
3

Browser fetches

Per value.

Buffer
=

Tuned UX

Speed vs data.

Browser Support

The preload attribute on audio and video is supported in all modern browsers. Interpretation is a hint and may vary.

HTML5 Media · Fully supported

Universal preload support

Buffering hints work on native audio and video players everywhere.

99% Browser support
Google Chrome Fully supported
Full support
Mozilla Firefox Fully supported
Full support
Apple Safari Fully supported
Full support
Microsoft Edge Fully supported
Full support
Internet Explorer IE 9+ supported
Full support
Opera Fully supported
Full support
preload attribute 99% supported

Bottom line: Safe for buffering hints on audio and video. Browsers may adjust behavior based on network conditions.

💡 Best Practices

✅ Do

  • Use preload="none" on pages with many video embeds
  • Pair preload="none" with poster on video
  • Use metadata when you need duration in the progress bar early
  • Use auto for primary hero media users will likely play
  • Test with DevTools Network tab to verify actual download size

❌ Don’t

  • Confuse media preload with link rel="preload"
  • Set preload="auto" on every embed on long pages
  • Assume browsers always obey the hint exactly
  • Apply preload to img or script tags
  • Rely on preload alone for performance — optimize file size too

Conclusion

The preload attribute lets you hint how much audio and video data to fetch before play — balancing instant playback against bandwidth cost.

Choose none, metadata, or auto based on how likely users are to press play, and remember it is separate from rel="preload" resource hints.

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about preload

Bookmark these before embedding media.

5
Core concepts
🚫 02

none

Save data.

Lightest
📄 03

metadata

Duration only.

Middle
04

auto

Full buffer.

Heaviest
05

Not rel=preload

Different API.

Gotcha

❓ Frequently Asked Questions

On audio and video, it hints how much media data the browser should fetch before the user presses play. Values are none, metadata, and auto.
If omitted or empty, the spec default is auto. Browsers may still adjust based on settings like data-saver mode.
No. Media preload controls buffering on audio/video. <link rel="preload"> is a document-head resource hint for fonts, scripts, styles, and images.
When many media elements appear on one page, or when most users may not play the clip. Pair with poster on video for a good idle appearance.
mediaElement.preload = "metadata" on the HTMLMediaElement. Set it as early as possible.
Yes on audio and video in all modern browsers (IE 9+). Behavior is a hint and may vary by network.

Tune media buffering

Practice preload values on audio, JavaScript updates, and lightweight video embeds in the Try It editor.

Try preload demo →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful