Adding Video to an HTML Document

This section looks at the ways video files can be linked to or embedded within an HTML document.

With a Simple Link

Video files can be linked to HTML documents using the standard link tag around a string of text or a graphic as follows:

<A HREF="video.mov"> Check out the video (1.3MB)</A>

When the user clicks on the link, the browser looks at the file type (as defined in the filename suffix) and launches a player application to play the movie. Which player it uses depends on how that user has the browser configured, so it is out of the control of the web page designer.

In most cases, the movie will open in a separate window with start and stop controls. Be aware that if the browser is configured to use a plug-in for the specified file type, the movie may load in the browser window, replacing the original web page.

If you are linking to a file that will need to be downloaded before it can be played, it is a good idea to print the size of the file so the user can make the decision whether to start the download.

If you are linking to a streaming format, you may need to link to a reference file (such as a .ram metafile for RealVideo) instead of to the actual video file. (Reference files are discussed in more detail in Chapter 19.) Carefully follow the vendor’s instructions for adding their streaming media to your page.

Table 20-1. Streaming Video Summary

Technology

File Type

Reference File Type

Live Broadcast

Player

Encoder

Server

Delivery[a]

Get Web Design in a Nutshell 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.