HTML preload Attribute

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The preload attribute on <audio> and <video> is an enumerated hint about how much media to fetch before the user presses play: none, metadata, or auto.

It is not a guarantee — browsers may ignore it (data saver, mobile networks, user settings). Not the same as <link rel="preload"> (see rel). Pair with poster when using none on video.

Hint only · Spec suggests metadata as default.

Missing/invalid defaults are implementation-defined; the HTML Standard recommends the Metadata state as a compromise.

autoplay wins over preload.

If the media must play automatically, the browser will download what it needs regardless of your preload hint.

HTML Syntax

syntax.html
<video preload=" none | metadata | auto">
<audio preload=" none | metadata | auto">

Empty string (preload="") means the same as auto. In JavaScript, read/write media.preload.

Attribute Values

Choose a hint based on how likely the user is to play the media:

ValueHintTry it
noneDo not preload; save bandwidth until playTry it
metadataFetch duration/dimensions (maybe a little data)Try it
autoBrowser may download the whole fileTry it
"" (empty)Same as autoTry it

Live Preview

Pick a preload value. The player updates, and the log shows video.preload (browsers may still fetch differently).

preload

Hint only — check Network tools in DevTools to see what your browser actually downloads.

Attribute

preload: none

HTML Examples

Short demos with site media. Use Try It Yourself for a live editor.

Example 1 — preload="none"

Best when many videos appear on a page and most will not be played.

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

How It Works

  1. preload="none" asks the browser not to fetch media early.
  2. poster still gives a visible frame without downloading the file.
  3. Play starts the download when the user asks.
  4. Saves bandwidth on pages with many players.

Example 2 — preload="metadata"

Balanced default-style hint: duration and size without pulling the whole file.

HTML
<video id="v" controls width="320" preload="metadata">
  <source src="/video/count.mp4" type="video/mp4">
</video>
<p id="info">Waiting for metadata…</p>
<script>
  var v = document.getElementById("v");
  v.addEventListener("loadedmetadata", function () {
    document.getElementById("info").textContent =
      "Duration: " + v.duration.toFixed(1) + "s";
  });
</script>
Try It Yourself

How It Works

  1. metadata hints that duration/dimensions are enough.
  2. loadedmetadata fires when that info is available.
  3. duration can be shown without full download.
  4. Good default when play is possible but not certain.

Example 3 — preload="auto" on Audio

Use when playback is very likely and you want buffering ready.

HTML
<audio controls preload="auto">
  <source src="/audio/count.mp3" type="audio/mpeg">
  <source src="/audio/count.ogg" type="audio/ogg">
</audio>
<p>preload="auto" — browser may fetch the whole file.</p>
Try It Yourself

How It Works

  1. auto allows optimistic full download.
  2. Same attribute works on <audio> and <video>.
  3. Use sparingly — wastes data if the user never plays.
  4. Empty preload="" is treated like auto.

Edge Cases & Pitfalls

Treat preload as advice — browsers often override it.

hint

Browsers may ignore the value

Data saver, cellular policies, or preferences can force none or metadata.

autoplay

autoplay overrides the hint

Playback requires buffering; including both attributes is allowed but preload is secondary.

many

Many videos → prefer none or metadata

Avoid auto on every player or you can stall other page resources.

link

Not <link rel="preload">

That is a different early-fetch hint for fonts, CSS, scripts, and more.

mse

MSE / streaming APIs

preload applies to simple src / <source> files, not Media Source Extensions streams.

Browser Support

preload is an HTML attribute on audio and video elements. It is not a Node.js, Deno, or Bun API.

✓ Widely available (hint)

preload

Supported across modern browsers as an advisory hint. Exact buffering still depends on the user agent and network conditions.

97% Global support (approx.)
Google Chrome Yes
Full support
Mozilla Firefox Yes
Full support
Apple Safari Yes
Full support
Microsoft Edge Yes
Full support
Opera Yes
Full support
Samsung Internet Yes
Full support
Internet Explorer 9+
Supported
preload Widely supported

Bottom line: Safe to set. Prefer metadata or none unless playback is highly likely; never treat preload as a hard download contract.

Key Takeaways

  • Role: hint how much media to fetch before play.
  • Values: none, metadata, auto.
  • Hint only — browsers may ignore it.
  • autoplay takes precedence when present.

One line: preload hints how aggressively to buffer <audio>/<video> — start with metadata or none unless play is almost certain.

Frequently Asked Questions

On <audio> and <video>, preload is an enumerated hint telling the browser how aggressively to fetch media before play: none, metadata, or auto. Browsers may ignore the hint.
none — do not preload; metadata — fetch length/dimensions (and maybe a little data); auto (or empty string) — the browser may download the whole resource.
It varies by browser. The HTML specification suggests metadata as a sensible default when the attribute is missing.
Yes. If autoplay is set, the browser must fetch enough media to play, regardless of the preload hint.
No. The media preload attribute hints buffering for audio/video elements. <link rel="preload"> is a separate resource hint for early fetching of fonts, scripts, and other assets.
No. It is a standard hint on HTMLMediaElement. Treat it as advisory, not a guarantee.

Next: readonly

Make form controls non-editable while still submitting their value.

readonly tutorial →

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.

8 people found this page helpful