Planetaryhtml
Home Back

P

Html videos

HTML5 defines DOM methods, properties, and events for the video element. This allows you to load, play, and pause videos, as well as setting duration and volume. Before HTML5, a video could only be played in a browser with a plug-in (like flash). The HTML5 video element specifies a standard way to embed a video in a web page. There are also DOM events that can notify you when a video begins to play, is paused, etc.

How it Works

The controls attribute adds video controls, like play, pause, and volume. It is a good idea to always include width and height attributes. If height and width are not set, the page might flicker while the video loads. The source element allows you to specify alternative video files which the browser may choose from. The browser will use the first recognized format.

Inserting a video or movie

Practice here

HTML (Body)
CSS
JavaScript
Output