HTML Video Tag

Learn step-by-step with live examples

What is Video Tag?

The <video> tag allows you to add videos directly into your webpage without using external players.

Basic Syntax

<video src="video.mp4" controls></video>
Attribute Use
controls Show video controls
autoplay Video plays automatically
loop Repeat video continuously
muted Start without sound
poster Show thumbnail image

Example with Preview

<video controls>
<source src="sample.mp4" type="video/mp4">
</video>

Video Thumbnail

<video controls poster="../images/thumbnail.png">
<source src="sample.mp4" type="video/mp4">
</video>

Important Attributes

Autoplay Example

<video autoplay muted loop>
<source src="sample.mp4" type="video/mp4">
</video>

Autoplay Example

<video controls autoplay muted loop>
<source src="sample.mp4" type="video/mp4">
</video>

Best Practices