- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to specify that the element is read-only in HTML?
In this article we are going to learn about how to specify if and how the authoe thinks the audio/video should be loaded when the page loads in HTML.
By using the HTML Audio Preload Attribute, the author can describe how they want the audio to load when the page does. This feature allows the author to tell the browser how to implement a website's user experience.
Note − The preload gets ignored when autoplay was present.
Syntax
Following is syntax for HTML preload attribute.
<video preload="auto|none">
For getting better understanding on how to specify if and how author thinks the audio/video should be loaded when the page loads in HTML.
<video>preload=” auto”
The preload=auto setting instructs the browser to download the whole video. The video is fully played again after starting with this method, which is the most data-intensive. The auto selection is used if the preload attribute isn't given a value.
Example
In the following example we are setting the preload=” auto”.
<!DOCTYPE html> <html> <body> <video width="320" height="240" controls preload="none"> <source src="https://samplelib.com/lib/preview/mp4/sample-5s.mp4"> </video> </body> </html>
On executing the above script, it will make the user reload the video that was uploaded with the image shown when the user tries to reload the webpage.
<video>preload =”none”
Preload=none instructs the browser to download 0 bytes of the video despite the fact that there is one present. There is no local video storage on the device, so this clearly saves data but comes at the expense of a delayed video startup.
Example
Considering the following example we are setting the preload=”none”.
<!DOCTYPE html> <html> <body> <video width="320" height="240" controls preload="none"> <source src="https://samplelib.com/lib/preview/mp4/sample-5s.mp4" type="video/mp4"> </video> </body> </html>
When the script gets executed, it makes the user not load the video when the webpage gets loaded
- Related Articles
- How to specify that the styles only apply to this element's parent element and that element's child elements in HTML?
- How to specify that an element is not yet relevant in HTML?
- How to specify that the element should automatically get focus when the page loads in HTML?
- How to specify that the element must be filled out before submitting the form in HTML?
- How to specify that an element should be pre-selected when the page loads in HTML?
- How to specify the language of the element's content in HTML?
- How to specify which form element a calculation is bound to with HTML?
- How to specify a unique id for an element in HTML?
- How to specify whether the or the element should have autocomplete enabled in HTML?
- How to specify that the details should be visible to the user in HTML?
- How to specify whether the element is to have its spelling and grammar checked or not in HTML?
- How to specify citation in HTML?
- How to specify the type of box used for an HTML element using CSS?
- How to specify that the form should not be validated when disabled in HTML?
- How to specify whether the content of an element should be translated or not in HTML?
