HTML <video> tag

You are Here:

HTML <video> tag

The <video> tag is used to add video files to an HTML document.

The <video> tag may contain one or more audio sources using source element: the browser will choose the most suitable one.

The text between the <video> and </video> will be displayed in browsers that do not support the <video> tag.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <video style="width:100%;height:330px" controls> <source src="/hawk.mp4" type="video/mp4"> Your browser does not support the video tag. </video> </body> </html>

Attributes

The following are the attributes of <video> tag. Also try Global attributes.

AttributeValueExplanation
autoplay-Specifies that the video will start playing as soon as it is ready.
controls-Specifies that video controls (play, mute, download etc.) should be displayed.
heightpxSpecifies the height of the video.
loop-Specifies that the video will iterate for infinite times, from start to end, everytime when it finished.
muted-Specifies that the video will be initially silenced.
posterURL.Specifies the image to be shown while the video is rendering. (Image only)
preload
  • auto
  • metadata
  • none
This attribute is intended to provide a hint to the web browser about what the author thinks will lead to the best user experience.
srcURLSpecifies the URL of the video file.
widthpxSpecifies the width of the video.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author