HTML Audio/Video DOM preload attribute

Instance

Once the page is loaded, the video starts to load:

myVid=document.getElementById("video1");
myVid.preload="auto";

Try It Yourself

Definition and Usage

The preload attribute sets or returns whether audio/video is loaded immediately after the page is loaded.

Browser Support

All major browsers support the seekable attribute.

Note:Internet Explorer 8 and earlier browsers do not support this attribute.

Syntax

Set preload attribute:

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

Return preload attribute:

audio|video.preload

Attribute Value

Value Description
auto Indicates that audio/video should start loading once the page is loaded.
metadata Indicates that only the metadata of audio/video should be loaded after the page is loaded.
none Indicates that audio/video should not be loaded after the page is loaded.

Return Value

Type Description
String Value auto|metadata|none