Sometimes you need to add music or video into your web page. The
easiest way to add video or sound to your web site is to include the
special HTML tag called . This tag causes the
browser itself to include controls for the multimedia automatically
provided browser supports tag and given media type.
You can also include a tag for the browsers
which don't recognize the
Dear readers, after reading the Content please ask for advice and to provide constructive feedback Please Write Relevant Comment with Polite Language.Your comments inspired me to continue blogging. Your opinion much more valuable to me. Thank you.
Sometimes you need to add music or video into your web page. The
easiest way to add video or sound to your web site is to include the
special HTML tag called . This tag causes the
browser itself to include controls for the multimedia automatically
provided browser supports tag and given media type.
You can also include a tag for the browsers
which don't recognize the tag. You could, for example, use
to display a movie of your choice, and
to display a single JPG image if browser does not support
tag.
Example
Here is a simple example to play an embedded midi file:
HTML embed Tagsrc="/html/yourfile.mid"width="100%"height="60">src="yourimage.gif"alt="Alternative Media">
This will produce following result:
You can put any media file in src attribute. You can try it yourself by giving various types of files.
The Tag Attributes
Following is the list of important attributes which can be used with tag.
Attribute
Description
align
Determines how to align the object. It can be set to either center, left or right.
autostart
This boolean attribute indicates if the media should start automatically. You can set it either true or 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)
playcount
Specifies the number of times to play the sound. This is alternate option for loop if you are usiong IE.
hidden
Specifies if the multimedia object should be shown on the page. A false value means no and true values means yes.
width
Width of the object in pixels
height
Height of the object in pixels
name
A name used to reference the object.
src
URL of the object to be embedded.
volume
Controls volume of the sound. Can be from 0 (off) to 100 (full volume).
Supported Video Types
You can use various media types like Flash movies (.swf), AVI's (.avi), and MOV's (.mov) file types inside embed tag.
.swf files - are the file types created by Macromedia's Flash program.
.wmv files - are Microsoft's Window's Media Video file types.
.mov files - are Apple's Quick Time Movie format.
.mpeg files - are movie files created by the Moving Pictures Expert Group.
HTML embed Tag
src="/html/yourfile.swf"width="200"height="200">src="yourimage.gif"alt="Alternative Media">
This will produce following result:
Background Audio
You can use HTML tag to play a soundtrack in
the background of your webpage. This tag is supported by Internet
Explorer only and most of the other browsers ignore this tag. It
downloads and plays an audio file when the host document is first
downloaded by the user and displayed. The background sound file also
will replay whenever the user refreshes the browser.
This tag is having only two attributes loop and src. Both these attributes have same meaning as explained above.
Here is a simple example to play a small midi file:
HTML embed Tag
src="/html/yourfile.mid">src="yourimage.gif">
This will produce blank screen. This tag does not display any component and remains hidden.
Internet Explorer can also handle only three different sound format
files: wav, the native format for PCs; au, the native format for most
Unix workstations; and MIDI, a universal music-encoding scheme.
HTML Object tag
HTML 4 introduces the element, which offers an
all-purpose solution to generic object inclusion. The
Post a Comment
0 comments
Dear readers, after reading the Content please ask for advice and to provide constructive feedback Please Write Relevant Comment with Polite Language.Your comments inspired me to continue blogging. Your opinion much more valuable to me. Thank you.