10.5. Object Examples

More data/media formats are delivered via the Web than can be readily counted. Each of the non-HTML-based formats has its own plugin, format for the <object> tag, and parameters. The best way to determine the correct format of the <object> tag is to consult the owner of the data format or applicable plugin (Macromedia for Flash content, Apple Computer Inc. for QuickTime, and so on).

Many GUI-based HTML editors include features to help embed non-HTML content in Web documents. For example, Macromedia's Dreamweaver provides several features to embed and control various objects within your documents.

The following two examples show how to embed commonly used data types: a MIDI file and a Flash file.

Example: Adding a MIDI Sound File to a Web Document

Although not as popular as it once was, background music on Web documents is still common. This example shows how to use the <object> tag to place a MIDI file (and appropriate media controls) in a Web document.

Source

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
  <title>A MIDI Object</title>
</head>
<body>
<p>
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id='jinglebells'
  height="45" width="300" />
  Jingle Bells!
  <param name="autostart" value="true" />
  <param name="filename" value="jinglebells.mid" />
</object>
</p>
</body>
</html>

This example will work only on Windows, with Microsoft Internet Explorer or a browser with ...

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP 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.