liveBook · Manning

Video element

As explained in Web Design Playground

An HTML element that embeds video content in a web page and can expose playback controls and related media behavior.

The HTML5 video element puts moving pictures directly on a web page. Think of it as a small screen that can show a poster image, provide playback controls, start automatically, or repeat when the video ends. section 6.28

Build the element in small pieces:

  • Use src to point to one video file. section 6.28
  • Use poster for an image displayed before playback, and width and height for the playback window. section 6.28
  • Add controls for browser playback controls, autoplay to begin after enough data downloads, and loop to restart after the video ends. section 6.28
  • Offer several formats with separate source elements; each source identifies its file and its video and audio codecs. section 6.29

A tiny video screen

A single-format video can look like this: <video src="movie.mp4" poster="movie-poster.jpg" width="625" height="480" controls loop></video>. The browser loads the video from src, shows the poster first, displays controls, and repeats playback. section 6.28

<video src="file" 
       poster="file" 
       width="value"
       height="value"
       controls
       autoplay
       loop>
</video>

Use this compact template as a checklist for the element's file, preview image, dimensions, and playback options. section 6.28

Media formats are the tricky part: a container packages media data and metadata, while codecs encode, compress, decode, and decompress it. There is no universal web media format, so multiple sources may improve format coverage. section 6.25 section 6.29

How Web Design Playground covers it

How deep it goes
Defines attributes and single- versus multiple-format syntax, but stops short of resolving broader media-format complexity.
Examples
Uses single-file and multiple-source videos with poster images, dimensions, playback controls, autoplay, and looping.
What you can do after
Build it from scratch by embedding one video or offering multiple format sources with playback options.
How it connects
Connects video embedding with the audio element, source element, media formats, containers, and codecs.

Also explained in

Compare how 3 books explain video element →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground. The section links point to the parts of the book it draws on.