YouTip LogoYouTip

Prop Video Preload

HTML DOM Video preload Property

HTML DOM Video preload Property

HTML DOM Video preload Property

-- Learning not just technology, but dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error

Browser Objects

Window Object Navigator Object Screen Object History Object Location Object Storage Object

DOM Objects

HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection

HTML Objects

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

HTML DOM Track Object

HTML DOM Video poster Property

Deep Dive

  • Programming
  • Scripting
  • Software
  • Web Service
  • Development Tools
  • Network Services
  • Computer Science
  • Web Design & Development
  • Scripting Languages
  • Programming Languages

Video preload Property

Image 8: Video Object Reference Manual Video Object

Example

Check if the video starts loading as soon as the page loads:

var x = document.getElementById("myVideo").preload;

x output result is:

none //The video should not be loaded when the page loads

Try it yourself Β»


Definition and Usage

The preload property is used to set or return the value of the video preload attribute.

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

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

Note: The <video> element is new in HTML5.


Browser Support

Image 9: Internet ExplorerImage 10: FirefoxImage 11: OperaImage 12: Google ChromeImage 13: Safari

All major browsers support the preload property.

Note: Internet Explorer does not support the preload property.


Syntax

Return the preload property:

videoObject.preload

Set the preload property:

videoObject.preload="auto|metadata|none"

Property Values

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

Technical Details

Return Value: A string representing the preloaded data. Possible return values are "auto", "metadata", or "none".

More Examples

Example

The following example demonstrates how to set different properties:

document.getElementById("myVideo").preload="none";

document.getElementById("myVideo").preload="auto";

Try it yourself Β»


Related Pages

HTML Reference: HTML <video> preload Attribute


Image 14: Video Object Reference Manual Video Object

← Prop Video ReadystateProp Video Preload β†’