You are here:  NetStrider » Tutorials » HTMLRef » Commands » EMBED «

HTML Reference Guide

Author: Randy D. Ralph.   In place March 1, 1999.   Copyright © 1999 NetStrider.   Presented as a public service.

BACK <EMBED> Command next

Command Syntax:

<EMBED src="URL" command parameters>

Displays or plays an audiovisual or audio file from a specified source src external to the HTML document within the document or in the background.  The file or object can be of any type so long as the parameters are set correctly to load and place it within the HTML document and the user's browser is using the appropriate plug-ins to display or play it.

Warnings:

  • Many corporate intranets and other secured sites will halt loading of a web page at the place in the code where an <EMBED> is encountered.  This is done because embedded files can contain viruses.  For this reason it is best not to embed files unless necessary and to place embedded files toward the bottom of the web page.

  • The file server on which the embedded object resides must MIME encode files of the type to be embedded or the embed will fail.
See also:  <BGSOUND>, <SOUND>
Command Parameters:
autostart="true | false"

Determines whether or not the display or play of the embeded object will proceed automatically or not.

border="pixels"

Defines the size of the border to place around the embedded object in pixels.

controls=bigconsole | smallconsole"

Determines which console will be used for controlling the play of audio files.

height="pixels"

Defines the height of the displayed object in pixels.

hspace="pixels"

Defines the standoff to place to the left and right of the embedded object in pixels.

loop="true | false | integer"

Determines whether or not the displayed audio or video file will loop and the number of times it will loop.  In the Netscape browser true indicates that the embedded file should loop continuously.

nosave="true | false"

Determines whether or not the browser will save a permanently cached copy of the embedded file on the client's machine.

src="URL"

Provides the URL at which the embedded object can be found.  The file server on which the object resides must MIME encode it properly.

vspace="pixels"

Defines the standoff to place to the top and bottom of the embedded object in pixels.

width="pixels"

Defines the width of the embedded object in pixels.

Examples:
<embed src="../../../music/rags/bethena.mid" tppabs="http://www.netstrider.com/music/rags/bethena.mid" height=15 width=50 controls="smallconsole" autostart="false" nosave="true" loop="true"> Produces this small console display ( ) which controls the playing of the embeded file bethena.midNetStrider).

The dimensions of the consoles are browser specific.  Those provided above work well only in the Netscape browser.  Values of 20 and 75 for height and width, respectively, would work well in the Internet Explorer browser.

The command parameters in the order given:

  • load the file bethena.mid from the URL provided
  • set the height and width of the console display to 15 and 50 pixels, respectively
  • display the small console style
  • prevent the music file from playing automatically in the background
  • do not permit the file to be saved
  • allow the music file to loop continuously when played


Similarly:

<embed src="../../../music/rags/bethena.mid" tppabs="http://www.netstrider.com/music/rags/bethena.mid" height=60 width=144 controls="bigconsole" autostart="false" nosave="true" loop="true"> Produces the big console display below.

The dimensions of the big consoles are browser specific.  Those provided work well only in Netscape.  Values of 25 and 200 for height and width, respectively, would work well in the Internet Explorer browser.

bethena.mid © NetStrider


Additionally, the code:

<embed src="../../../music/rags/bethena.mid" tppabs="http://www.netstrider.com/music/rags/bethena.mid" height=2 width=2 autostart="true" nosave="true" loop="true"> Would load the file into the background and play it continuously and automatically without any display at all.  The critical elements height=2 and width=2 force the file to play in the background.  The technique works well in Netscape and Internet Explorer browsers.

Warning:  Most Internet users find this intensely annoying.

bethena.mid © NetStrider


Finally:

The simplified code -

<embed src="../../../music/rags/bethena.mid" tppabs="http://www.netstrider.com/music/rags/bethena.mid" autostart="true" nosave="true" loop="true"> In the Netscape browser would load the file into a big console window outside the browser which the user could control and even close.  In the Internet Explorer browser the large console would be included on the page at the point of the embed.  Either is a much better alternative to automatic music file embeds if you must play music on your pages.

bethena.mid © NetStrider

Return to Section E:H


Return to the List of Commands
Author: Randy D. Ralph.  In place March 1, 1999.  Copyright © 1999 NetStrider.  World Rights reserved.




Hosted by uCoz