The Question was : How do I insert multimedia objects in Web document in a backward compatible way?. It has been decided to create two articles:


WAW - Add Multimedia in Web Documents Part 1

Introducing multimedia objects in a Web documents has a large variety of flavours and techniques depending on the technology and the types of objects, we are addressing. A Web document can be written in SVG, SMIL, XHTML, MathML, CSS, etc. In this first part of two, we will introduce the birth of img element, will explain its limitations and will introduce the object element. In the second part, we will give examples of usage of the object element and gives an overview on the state of implementation accross various user agents.

History

Birth of Multimedia in HTML

Reading the archived mailing-lists helps often to understand the context of the creation of a feature in a technology. There is always a balance between being universal (but often more complex) and being fast (but often limited and incomplete). Jeffrey Veen gives an historic perspective on the birth of a long waited feature of HTML, the possibility to insert images in an HTML document.

In 1993, a debate was exploding on the fledgling HTML mailing list, and finally a college student named Marc Andreessen added <img> to his Mosaic browser. People objected, saying it was too limited. They wanted <include> or <embed>, which would allow you to add any sort of medium to a Web page with the much-touted content negotiation used on the client. That was too big a project, according to Marc, and he need to ship ASAP. Mosaic went with <img>, and it would be years before including media in a page using <embed> or <applet> or <object> would surface again.

Mosaic shipped with <img>, Tim went off to the nascent World Wide Web Consortium, and Marc left for California to start a little browser company called Netscape.

The history of HTML - Jeffrey Veen

We can still find the original message of Marc Andreessen in the 1993 archived www-talk mailing-list:

 IMG

Required argument is SRC="url". 

 This names a bitmap or pixmap file for the browser to attempt to pull
 over the network and interpret as an image, to be embedded in the text
 at the point of the tag's occurrence.

An example is:

 <IMG SRC="file://foobar.com/foo/bar/blargh.xbm"> 

(There is no closing tag; this is just a standalone tag.)

proposed new tag: IMG - Marc Andreessen

Since this time, the img element has been used for inserting graphics and pictures in an HTML documents, and unfortunately abused in many ways to create fancy menus or sometimes awful layouts where one big splash image was cut in many table cells.

Image element

The most common way of inserting an element in an HTML document from HTML 3.2 to XHTML 1.1 is to use the IMG elements. You can insert many formats if they are supported. The HTML specifications do not define any requirements for the format which have to be supported but usually supported format are: GIF, JPEG, PNG, TIFF, XBM. There was a time where you needed a plug-in to view PNG files (@@Is it true?@@).

Note from Karl: There's not list of supported format? all mime-types with image/something?

The IMG element embeds an image in the current document at the location of the element's definition. The IMG element has no content; it is usually replaced inline by the image designated by the src attribute, the exception being for left or right-aligned images that are "floated" out of line.

Examples of markup for IMG element

in HTML 4.01

<p><IMG src="http://example.org/bzcam.png"
     alt="Image de l'étoile variable cataclysmique BZ Cam."></p>

The same example in XHTML 1.0

<p><img src="http://example.org/bzcam.png"
     alt="Image de l'étoile variable cataclysmique BZ Cam."/></p>

You will find exploration on use of HTML markup to insert images in documents at the following websites:

Limitations?

Images are one type of multimedia documents and a very limited one. What about small programs, movies, sounds, etc? It has appeared that there was a need for other kind of elements. First was introduced applet element for Java type programs. It was not enough, there was still a need for an object to insert other kind of multimedia objects. We can notice that we have already two elements which address the same issue: how to insert an object (any kind) in an HTML document?.

EMBED is NOT HTML!

Unfortunately, in the mean time, some vendors have created an embed element, which is well supported by legacy browsers, but which is not part of any W3C recommendations. (@@Does embed have problems beside the fact to not be part of any spec?@@)

(look for the Apple article or alistapart on how to put flash in your web page or quicktime)

Objects

Therefore, the object element was introduced in HTML 4.01. It has been created to give the possibility to use a generic way to insert multimedia object of any kind in a Web document. The element has a very powerful cascading mechanism. If your first format is not supported, the user agent can try to display the second embedded element and so on, until it reaches the last fallback mechanism, often a simple text describing the content of the multimedia document.

deprecation of applet

We have mentionned the APPLET element above. APPLET has been deprecated in HTML 4.01. It should not be used anymore. It is a double usage with the generic OBJECT element.

In the second part, we will show how to use the object element and WASP will give a table on the level of support of this element in user agents.


Valid XHTML 1.0!
Created Date: 2004-02-19 by Karl Dubost
Last modified $Date: 2004/05/04 15:05:16 $ by $Author: kdubost $

Copyright © 2000-2003 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.