HTML Audio/Video DOMpreloadProperty

HTML audio/video 标签参考手册HTML Audio/Video DOM Reference Manual

Example

Start loading the video as soon as the page loads:

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

Try it Yourself »

Definition and Usage

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

The preload property allows the author to provide a hint to the browser about what he/she believes will lead to the best user experience. This property is ignored in some cases.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the preload property.

Note:Internet Explorer 8 and earlier versions do not support this property.


Syntax

Set the preload property:

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

Return the preload property:

audio|video.preload

Property Values

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

Technical Details

Return Value: String value, auto|metadata|none


HTML audio/video 标签参考手册HTML Audio/Video DOM Reference Manual Other Extensions