👀 Live Preview
Audio with preload="metadata" — duration loads without full download:
Waiting for metadata…

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.
Before play.
Save data.
Duration only.
Full buffer.
Only elements.
JS property.
preload AttributeMedia 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.
rel="preload"<link rel="preload" href="…" as="font"> fetches fonts, scripts, or images early. The preload attribute on audio/video controls media buffering only.
Add preload with one of three keyword values on audio or video:
<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>none, metadata, auto.auto per HTML spec.<audio> and <video>.media.preload = "metadata" on HTMLMediaElement.poster on video when using preload="none".preload="none".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).<!-- 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>| Value | What loads | Best for |
|---|---|---|
none | Nothing until play | Many embeds, mobile data |
metadata | Duration, size, tracks | Show progress bar length early |
auto | Full media (hint) | Hero videos, podcasts |
media.preload | JS read/write | Dynamic players |
| Default (omitted) | Treated as auto | Spec default |
With poster | Thumbnail + no buffer | Lightweight video cards |
| Element | Supported? | Notes |
|---|---|---|
<video> | Yes | Primary use case |
<audio> | Yes | Podcasts, music players |
<source> | No | Set preload on parent media element |
<link> | No | Use rel="preload" instead (different feature) |
<img> | No | Images load via src |
preload vs poster vs rel="preload"| Feature | Element | Purpose |
|---|---|---|
preload attribute | audio, video | How much media to buffer before play |
poster attribute | video | Thumbnail image before play |
rel="preload" | link in head | Early fetch of fonts, CSS, JS, images |
autoplay | audio, video | Start playback automatically |
Compare preload values on audio, set media.preload in JavaScript, and pair preload="none" with poster on video.
Audio with preload="metadata" — duration loads without full download:
Waiting for metadata…
Three preload strategies on the same audio file:
<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>Each value changes how aggressively the browser fetches media bytes on page load. Use DevTools Network tab to compare download size before pressing play.
Set preload on a media element before the user interacts:
<video id="myVideo" controls width="320">
<source src="/video/count.mp4" type="video/mp4">
</video>
<script>
document.getElementById("myVideo").preload = "metadata";
</script>HTMLMediaElement.preload accepts "", none, metadata, or auto. Useful when building players that adapt to connection quality.
Lightweight video embed: thumbnail visible, no media download until play:
<video
controls
width="320"
preload="none"
poster="/images/apple.png">
<source src="/video/count.mp4" type="video/mp4">
</video>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.
<track kind="captions"> for accessible spoken content regardless of preload value.preload="none" respects users on limited data plans who may never play media.muted if required.controls or custom accessible controls so users can start playback.Media element.
none/metadata/auto.
Per value.
Speed vs data.
The preload attribute on audio and video is supported in all modern browsers. Interpretation is a hint and may vary.
preload supportBuffering hints work on native audio and video players everywhere.
Bottom line: Safe for buffering hints on audio and video. Browsers may adjust behavior based on network conditions.
preload="none" on pages with many video embedspreload="none" with poster on videometadata when you need duration in the progress bar earlyauto for primary hero media users will likely playpreload with link rel="preload"preload="auto" on every embed on long pagespreload to img or script tagsThe 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.
preloadBookmark these before embedding media.
Only elements.
ScopeSave data.
LightestDuration only.
MiddleFull buffer.
HeaviestDifferent API.
Gotchaaudio and video, it hints how much media data the browser should fetch before the user presses play. Values are none, metadata, and auto.auto. Browsers may still adjust based on settings like data-saver mode.preload controls buffering on audio/video. <link rel="preload"> is a document-head resource hint for fonts, scripts, styles, and images.poster on video for a good idle appearance.mediaElement.preload = "metadata" on the HTMLMediaElement. Set it as early as possible.audio and video in all modern browsers (IE 9+). Behavior is a hint and may vary by network.Practice preload values on audio, JavaScript updates, and lightweight video embeds in the Try It editor.
5 people found this page helpful