The <embed> Tag

The EMBED tag is a general tag first implemented by Netscape to add many types of media into your Web page. The EMBED tag has been supported in Netscape's Navigator since version 2.0 and in Internet Explorer since version 3.0. The EMBED tag itself has yet to be specified as an HTML standard. Therefore, browsers support various attributes in various versions.  You can embed many different objects that are supported by browser plug ins. In fact, if the browser recognizes the MIME type of the object, then you can embed nearly anything. The most common things to embed are movies and sound files.

When using the EMBED tag to include music on your Web site, the one required attribute is SRC. This attribute defines the name and path to the file to be played. You need to make sure that the file you would like to play is on the Web server, and the path to it is accurate.

The other attributes you should know when using the EMBED tag to play music are HIDDEN, AUTOSTART, and LOOP. HIDDEN is used as a stand alone attribute and tells the browser to show nothing to the reader when playing the music. Without this attribute, the browser might show a control panel to allow your readers to adjust the volume of the sound or start and stop the music. AUTOSTART and LOOP can be either true or false.

For example:
If you would like to have the file HELLO.MID played once with no control panel, you would add a tag to  your document that looks like:

<embed src="HELLO.MID" hidden autostart="true" loop="false" />

If you would like the file MUSIC.AU played infinitely with a control panel displayed, you would add a tag to  your document that looks like:

<embed src="MUSIC.AU" loop="true" />

 

Tips for Using Sound

One thing to keep in mind when using sound files on your Web pages is that some people would rather listen to music of their own choice rather than yours. I would recommend not using the "HIDDEN" attribute on EMBED tags, as this allows your readers to choose if they want the sound on or not.