Embedding Files Using the object Element

Another means of providing audio, video, and other multimedia such as Flash animations and Java applets is to embed them directly into the page. This means that the software plug-in automatically loads with the page.

All external files are considered objects. This includes images as well as multimedia files. In contemporary HTML and XHTML specifications, the proper way to include all multimedia is to use the object element to embed a file directly:

<object data="media/video-sample.avi" type="video/avi" />

This results in the player application appearing on the page. The video can then be played (see Figure 3-10).

Figure 3-10. The embedded player loaded into Internet Explorer.

NOTE

Of course, ...

Get Spring Into HTML and CSS 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.