7.9 Video

In this section, you’ll learn how to implement a video player with the video element. The video element is fairly similar to the audio element, so much of this discussion should sound familiar.

video Element Syntax

In the old days, end users had to install a plug-in to play a video from a web page. Fortunately, that’s no longer the case. Today’s browsers include a built-in video player that’s used in conjunction with HTML5’s video element. Here’s a video element example:

<video src="stBernardClimbsFlagPole.mp4"
  width="350" height="260"
  preload="metadata" controls
  poster="stBernardClimbsFlagPole.jpg"></video>

Like the audio element, the video element requires a start tag and an end tag even when there’s no content between the tags. ...

Get Web Programming with HTML5, CSS, and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.