The preload attribute on a <video> element specifies if and how the video file is loaded after the page loads.
The preload value is ignored if the video is set to autoplay.
A preload attribute on an <video> player.
The preload option is none. The video is only loaded when the start button is clicked.
<video width="320" controls preload="none">
<source src="/media/movie.mp4" type="video/mp4">
<source src="/media/movie.ogg" type="video/ogg">
</video>
The preload attribute specifies if and how the video file is loaded after the page loads.
This attribute can specify that the video file is loaded even if it is never used.
<video preload="auto | metadata | none">
Value | Description |
---|---|
auto | Loads the entire video file when the page loads. |
metadata | Only loads video metadata when the page loads. |
none | Indicates that the video file will not be preloaded. |
Note: Each browser has its own default value for preload
.
For consistency the metadata
setting is a reasonable option.
Here is when preload support started for each browser:
Chrome
|
4.0 | Jan 2010 |
Firefox
|
4.0 | Mar 2011 |
IE/Edge
|
9.0 | Mar 2011 |
Opera
|
10.5 | Mar 2010 |
Safari
|
3.1 | Mar 2008 |
Back to <video>