💡 Tip: Login now to track your course progress and unlock your downloadable certificates instantly!

HTML Video

The HTML <video> element allows you to embed videos directly on web pages without relying on external plugins. You can display movies, tutorials, animations, or any video content. <video> supports multiple formats, provides built-in controls, and can autoplay, loop, or be muted for a better user experience.

HTML <video> Syntax

HTML Video Example
<video controls>
  <source src="sample_video.mp4" type="video/mp4">
  <source src="smaple_video.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

Explanation

  • <video>: The container for video content.
  • controls: Displays standard video controls like play, pause, volume, and fullscreen.
  • <source>: Specifies video files and types. Multiple sources improve browser compatibility.
  • Fallback text: Displayed if the browser does not support the <video> element.

Attributes of <video>

  • controls: Shows video controls.
  • autoplay: Starts playing automatically when the page loads.
  • loop: Plays video repeatedly.
  • muted: Mutes the video initially.
  • poster: Displays an image before the video starts.
  • width / height: Sets the size of the video player.
Example with Multiple Attributes
<video width="640" height="360" controls autoplay muted loop poster="/samples/sample_thumbnail.png">
  <source src="/samples/sample_video.mp4" type="video/mp4">
  <source src="/samples/sample_video.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

Supported Video Formats

  1. MP4 — most widely supported across all browsers.
  2. WebM — modern, open-source format with good compression.
  3. OGG / OGV — older open-source format.

⚠️ Tip: Provide multiple formats to ensure all browsers can play your video.

Example: Complete HTML Video Player

HTML Video Complete Example
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>HTML Video Example</title>
</head>
<body>

<h2>Watch Our Tutorial Video</h2>
<video width="640" height="360" controls poster="/samples/sample_thumbnail.png">
  <source src="/samples/sample_video.mp4" type="video/mp4">
  <source src="/samples/sample_video.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

<p>Enjoy the video directly in your browser with built-in controls!</p>

</body>
</html>

Advantages

  • Embed videos without third-party plugins.
  • Cross-browser support with multiple source formats.
  • Customizable playback with attributes like controls, autoplay, loop, and poster.
  • Enhances engagement and user experience on your website.

Conclusion

The HTML <video> element allows seamless video integration for websites.
Using multiple formats, the controls attribute, and optional features like poster and autoplay ensures your content is accessible, engaging, and compatible across modern browsers.

Videos make your web pages dynamic, interactive, and professional, all without additional plugins.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend