Πρόβλεψη Προεφόρτωσης Βίντεο

Definition and usage

preload The attribute sets or returns the video's preload attribute The value.

preload The attribute specifies whether and how the video should be loaded when the page loads.

preload The attribute allows the author to provide hints to the browser about what they believe will provide the best user experience. In some cases, this attribute may be ignored.

Note:If the autoplay attribute exists, ignore preload Attribute.

Instance

Example 1

Find out whether and how the video should be loaded when the page loads:

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

Try it yourself

Example 2

Demonstrate how to set different attribute values:

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

Try it yourself

Syntax

Return the preload attribute:

videoObject.preload

Set the preload attribute:

videoObject.preload = "auto|metadata|none"

Attribute value

Value Description
auto When the page loads, the browser should load the entire video.
metadata When the page loads, the browser should only load metadata.
none Ο περιηγητής δεν πρέπει να φορτώσει το βίντεο κατά τη φόρτωση της σελίδας.

Τεχνικές λεπτομέρειες

Αποτελεσματική τιμή:

Αντικειμενική τιμή κειμένου, που δείχνει ποια δεδομένα πρέπει να προφορτωθούν (αν υπάρχουν).

Οι πιθανές τιμές επιστροφής είναι: "auto", "metadata" ή "none".

Υποστήριξη Περιηγητή

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Υποστήριξη 9.0 Υποστήριξη Υποστήριξη Υποστήριξη

Σχετικές Σελίδες

Εγχειρίδιο HTML:HTML <video> Πρόβλεψη Προεφόρτωσης Βίντεο