<video>...</video>

HTML4 HTML5

The <video> tag is used to embed a video player directly into a web page. It allows playback of video files and animations without needing external plugins.

Inside the <video> tag, you can place one or more <source> tags specifying video files in various formats (e.g., MP4, WebM, Ogg), allowing the browser to choose the first supported format. Text placed inside the element will only be displayed in browsers that do not support video playback.

Both opening and closing tags are required.

Attributes:

Example

In the example below, the <video> tag defines a video player with controls enabled (play buttons) and a preview image (thumbnail):

Code:

<video controls width="360" height="200" poster="https://interactive-examples.mdn.mozilla.net/media/examples/poster.png"> <source src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/friday.mp4" type="video/mp4"> Your browser does not support the video player. </video>

The browser will interpret this code as follows: