Advertisement
Home Open Editor ❯

HTML Audio/Video DOM preload Property

Example

var vid = document.getElementById("myVideo");

function checkPreload() {
  alert(vid.preload);
}

function enablePreload() {
  vid.preload = "auto";
}

function disablePreload() {
  vid.preload = "none";
}

Try this code ❯

Meaning

The preload property sets or returns whether the audio/video should be loaded when the page loads.

Return a String value, representing what data should be preloaded (if any). Possible return values are "auto", "metadata", or "none". See "Property Values" for what the values mean.


Standard Syntax

Return the preload property:

audio|video.preload

Set the preload property:

audio|video.preload="auto|metadata|none"


Advertisement

Property Value

Type Description
auto Specifies that the audio/video should start loading as soon as the page loads.
metadata Specifies that only the metadata for the audio/video should be loaded when the page loads.
none Specifies that the audio/video should NOT start loading as soon as the page loads.
Home Open Editor ❯
Advertisement