The <embed> tag – It is the easiest way to add video or sound to a web page by including the <embed> tag. It causes the browser to include controls for the multimedia automatically and no need to have any ActiveX, Java VM, VBscript or JavaScript to support this <embed> tag.
The <noembed> tag is included to support browsers which don’t recognize the <embed> tag. For example, use <embed> to display a movie, and <noembed> to display a single JPG image as shown
<embed src=”/sound/sample.mid” width=”100%” height=”60″ >
<noembed><img src=”sample.jpg” ></noembed>
</embed>
Another example to play a flash file is
<embed src=”/flash/sample.swf” width=”100%” height=”250″ >
<noembed><img src=”image.jpg” alt=”image.jpg” /></noembed>
</embed>
Any media file can be given in src attribute. Other attributes of <embed> tag are
align – It determines how to align the object and has value of either center, left or right.
autostart – Indicates if the media should start automatically. Netscape default is true, Internet Explorer is false.
loop – Specifies if the sound should be played continuously (set loop to true), a certain number of times (a positive value) or not at all (false). This is supported by Netscape only.
playcount – Specifies the number of times to play the sound. This is an option for loop if you are using IE.
hidden – Defines if object shows on web page. A false value means no and true means yes.
height – Height of the object in pixels.
width – Width of the object in pixels.
pluginspage – Specifies the URL to get the plug-in software.
name – A name used to reference the multimedia object to play.
src – URL of the object to be embedded. This can be any recognizable by the user’s browser. It could be .mid, .wav, .mp3, .avi, etc.
volume – Controls volume of the sound. Can be from 0 (off) to 100 (full volume). It is supported by Netscape only.
The <object> tag – It offers an easy solution for including objects in a web page. It allows HTML authors to specify everything required by an object for its presentation by a web browser. It tells the browser following information on the multimedia object
The name of the file and where to find it
The format of the file
The type of plug-in used to play the file
A webpage can be embedded in another web page as
<object data=”page1.htm” type=”text/html”
width=”300″ height=”200″>
alt : <a href=” page1.htm”> page1.htm</a>
</object>
The <object> tag is used to include objects such as images, audio, videos, Java applets, ActiveX, PDF, and Flash. It was intended to replace the img and applet elements. However, because of bugs and a lack of browser support this has not happened. Its support in browsers depends on the object type as browsers use different codes to load the same object type. But this problem is solved as if the object element is not displayed, the code between the <object> and </object> tags will be executed. Thus several nested object elements can be inserted one for each browser.
Parameters used by this tag are
Classid – It defines a class ID value as set in the Windows Registry or a URL Its value is
class_ID
Codebase – It defines where to find the code for the object Its value is URL
Codetype – The internet media type of the code referred to by the classid attribute Its value
is MIME_type.
Data – It defines a URL that refers to the object’s data Its value is a URL
Height – It defines the height of the object Its value is in pixels
Hspace – It defines the horizontal spacing around the object Its value is in pixels
Name – It defines the name for an object (to use in scripts).
Type – Defines the MIME type of data specified in the data attribute Its value is MIME_type
Vspace – Defines the vertical spacing around the object Its value is pixels
Width – Defines the width of the object Its value is pixels