Date First Published: 24th February 2023
Topic: Web Design & Development
Subtopic: Web Development
Article Type: Computer Terms & Definitions
Difficulty: MediumDifficulty Level: 5/10
Learn more about what the HTML <video> tag is in this article.
In HTML, the <video> tag is used to embed a video file in a HTML document, such as a film or a song. This HTML5 tag supports videos in the MP4, WebM, and OGG format, includes built-in functionality to customise how the video works on the webpage, and is supported by modern web browsers.
The <video> tag contains one or more source tags with multiple video sources. The browser will choose the first source it supports. When adding this tag to a webpage, it creates a video player with media controls, such as start, stop, volume, full screen, and more. The width and height attributes can be added to instruct the browser on how to display the video.
The HTML5 <video> tag is now one of the most commonly used ways of including video content. It allows videos to be displayed without having to rely on a plugin or browser extension. Before HTML5 was released, videos were most commonly embedded using the Adobe Flash plugin. Flash became less necessary and Adobe dropped support for Flash on 31st December 2020.
Even though the <video> tag can play audio files, the audio tag is more suitable.
The text between the <video> and </video> tags only displays in browsers that do not support the video element.
An example of the <video> tag can be seen below:
Below are the attributes for the <video> tag.
Attribute | Description |
---|---|
autoplay | Specifies that the video will start playing as soon as it loads. |
controls | Specifies that video controls, such as a play/pause button should be displayed. |
height | Sets the height of the video player. |
loop | Specifies that the video should play again every time it is finished. | muted | Specifies that the audio output of the video should be muted. | poster | Sets an image to use until the user clicks on the play button or whilst the video is downloading. | preload | Specifies how and when the video should be loaded when the page loads. | src | Specifies the URL of the video file. | width | Sets the width of the video player. |
If so, it is important that you tell me as soon as possible on this page.
Network Services Network Setups Network Standards Network Hardware Network Identifiers Network Software Internet Protocols Internet Organisations Data Transmission Technologies Web Development Web Design Web Advertising Web Applications Web Organisations Web Technologies Web Services SEO Threats To Systems, Data & Information Security Mechanisms & Technologies Computer Hardware Computer Software Ethics & Sustainability Legislation & User Data Protection