HTML Tutorial
Menu
HTML Forms
Menu
HTML Graphics
Menu
HTML Media
Menu
HTML API
Menu
HTML Video
The HTML <video> element displays a video on a web page
The HTML <video> Element
Using the <video> element displays a video in HTML:
How it Functions
- The controls attribute is used for adding the video controls, like play, pause, and volume.
- Always include width and height attributes. The page may flicker when the video loads if the height and width are not set.
- The <source> element specifies alternative video files, chosen by the browser. The browser recognizes the first used format.
HTML <video> Autoplay
Using the autoplay attribute, starts a video automatically:
HTML Video – Methods, Properties, and Events
- The HTML DOM specifies methods, properties, and events for the <video> element.
- It enables you to load, play, and pause videos, as well as set the duration and volume.
Example: Using JavaScript