Unit2 L4 HTML Multimedia
Unit2 L4 HTML Multimedia
• A link is specified using HTML tag <a>. This tag is called anchor
tag and anything between the opening <a> tag and the closing
</a> tag becomes part of the link and a user can click that part
to reach to the linked document. Following is the simple syntax
to use <a> tag.
<!DOCTYPE html>
<html>
<head>
<title>Hyperlink Example</title>
</head>
<body>
<p>Click following link</p>
<a href = "https://www.dspsr.in" target = "_self">DSPSR</a>
</body>
</html>
HTML Target Attribute
_top Opens the linked document in the full body of the window.
<head>
<title>Hyperlink Example</title>
</head>
<body>
<p>Click following link</p>
<a href = "https://www.dspsr.in" target = "_self">DSPSR</a>
<a href = "https://www.dspsr.in" target = "_parent">DSPSR</a>
<a href = "https://www.dspsr.in" target = "_blank">DSPSR</a>
</body>
</html>
Linking to a Page Section
add an image with a link attached to it. When the user clicks on
<a href="link.html">
<img src="map.png" alt="HTML tutorial" />
</a>
HTML - Embed Multimedia
• 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 <embed>. This tag causes the browser itself
to include controls for the multimedia automatically provided browser
supports <embed> tag and given media type.
• You can also include a <noembed> tag for the browsers which don't
recognize the <embed> tag. You could, for example, use <embed> to
display a movie of your choice, and <noembed> to display a single JPG
image if browser does not support <embed> tag.
<!DOCTYPE html>
<html>
<head>
<title>HTML embed Tag</title>
</head>
<body>
<embed src = “abc.mpeg" width = "100%" height = "60" >
<noembed><img src = "yourimage.gif" alt = "Alternative Media" > </noembed>
</embed>
</body>
</html>
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.
The <embed> Tag Attributes
Sr.No Attribute & Description
1 align
Determines how to align the object. It can be set to either center, left or right.
autostart
2
This boolean attribute indicates if the media should start automatically. You can set it either true or false.
loop
3
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)
4 playcount
Specifies the number of times to play the sound. This is alternate option for loop if you are usiong IE.
5 hidden
Specifies if the multimedia object should be shown on the page. A false value means no and true values means yes.
6 width
Width of the object in pixels
7 height
Height of the object in pixels
8 name
A name used to reference the object.
9 src
URL of the object to be embedded.
10 volume
Controls volume of the sound. Can be from 0 (off) to 100 (full volume).