html tutorial - preload Attribute in HTML - html5 - html code - html form



Preload attribute in html

Learn html - html tutorial - Preload attribute in html - html examples - html programs

  • The preload attribute is used to specify the media file should be loaded when the page loads.
  • This is an optional tag we can ignore the attribute specification.

Syntax for preload attribute in HTML:

<video preload="none">

Difference between HTML 4.01 and HTML 5 for preload Attribute:

HTML 4.01

  • HTML 4 does not support the <video> tag.

HTML 5

  • The <video> tag is new to HTML 5.

Applies To:

Elements Attribute
<video> preload
<audio> preload

preload Attribute Value:

Value Description
auto To load the entire media file when the page loads.
metadata To load only the meta data.
none Should not load the file when the page loads.

Sample Coding for preload Attribute in HTML:

Tryit<!DOCTYPE html>
<html>
    <head>
        <title>Wikitechy preload attribute</title>
    </head>
    <body>
        <video preload="none" width="320" height="240" controls>
            <source src="video.mp4" type="video/mp4">
        </video>
    </body>
</html>

Code Explanation for preload Attribute in HTML:

preload Attribute Code Explanation

  1. preload attribute used to specify the video file should be loaded when the page loads.
  2. Source file of video is specified as “video.mp4”.

Output for preload Attribute in HTML:

preload Attribute Output

  1. The output shows the video file did not loaded when the page load.
  2. preload Attribute Output
  3. When the user hit the play button the video starts loading.

Browser Support for preload Attribute in HTML:

4.0 No 4.0 4.0 10.5

Related Searches to preload Attribute in html