HTML - Video

HTML Video

In this tutorial, I will be showing you how to add video to your HTML web page.

Video

The <video> element is used to add video to your HTML web page.

  • The <video> element cannot work alone; it works together with the <source> element.
  • The <source> element takes two major attributes:
    • src - specifies the URL (address/location) of the video
    • type - specifies the video format type
  • The <video> element also takes attributes such as width, height, etc

<video> Attributes

Below are some of the majorly used <video> attributes.

CONTROLS

The controls attribute is used to add controls such as: play, pause and volume

AUTOPLAY

The autoplay attribute is used to play a video automatically as soon as the web page loads up.

MUTED

The muted attribute is used to turn OFF the volume of the video when it automatically starts playing. This attribute is often used together with the autoplay attribute.

LOOP

The loop attribute is used to set the video to start over again (from the beginning) every time it ends.

POSTER

The poster attribute is used to display a specific image to be seen while the video is still downloading or before the user clicks on the play button.

ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT