elibraryportal Logo

HTML Video

The <video> element is used to show a video on a web page.

Syntax:-

Example:-

Test it Now

Tag-Specific Attributes

The following table shows the attributes that are specific to the <video> tag.

Attribute Description
Autoplay This Boolean attribute specifies that the video will automatically start playing.
controls If specified, the browsers will display controls to allow the user to control video playback, such as play/pause, volume, etc.
height Sets the height of the video's display area.
loop This Boolean attribute specifies that the video will automatically start over again, upon reaching the end.
muted This Boolean attribute specifies whether the video will be initially silenced.
poster Specifies an image to be shown while the video is downloading, or until the user hits the play button. If this attribute isn't specified, nothing is displayed until the first frame of the video is available; then the first frame is displayed as the poster.
preload Provides a hint to the browser about whether to download of the video itself or its metadata.
src Specifies the location of the video file to embed. Alternatively, you can use the preferred source tag as it allows for multiple options.
width Sets the width of the video's display area.