Home > Web Front-end > Front-end Q&A > What does preload mean in html5

What does preload mean in html5

WBOY
Release: 2022-09-02 16:28:55
Original
4552 people have browsed it

In HTML5, preload means "preloading" and is used to specify whether to load audio or video after the page is loaded. If the autoplay attribute is set, this attribute will be ignored, and the preload attribute is in HTML5 The new attribute of , the syntax is "".

What does preload mean in html5

The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer.

What does preload mean in html5

The preload attribute specifies whether to load audio after the page is loaded.

If the autoplay attribute is set, this attribute is ignored.

The preload attribute is new in HTML 5. The

The syntax is:

<audio preload="auto|metadata|none">
Copy after login
<video preload="auto|metadata|none">
Copy after login

Specifies whether to preload audio.

Possible values:

  • auto - Load the entire audio when the page loads

  • meta - When the page loads Only load metadata

  • none - Do not load audio when the page loads

Example is as follows:

Does not load

<video width="320" height="240" controls preload="none">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  您的浏览器不支持 video 标签。
</video>
Copy after login

Output result:

What does preload mean in html5

Loads after the page is loaded

<video width="320"    style="max-width:90%" controls preload="auto">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  您的浏览器不支持 video 标签。
</video>
Copy after login

Output result:

What does preload mean in html5

(Learning video sharing: css video tutorial, html video tutorial)

The above is the detailed content of What does preload mean in html5. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template