HTML multimedia
Text and graphics are good for presenting content on the web, but what if you can include multimedia on your page(s)?
This lesson focuses on:
- The <embed> tag
The <embed> tag
The <embed> tag can be used to place multimedia on webpages.
NOTE: The <embed> tag is not part of the HTML 4.01 specifications. Despite this, it is still widely used and supported by modern browsers.
NOTE: The <embed> tag has no end tag.
<embed> tag attributes:
-
src
Denotes the URL of a multimedia file. -
width
Specifies the width of the control panel for the file. -
height
Specifies the height of the control panel for the file. -
hidden
Takes the value of 'true' or 'false' to specify if the control panel should be displayed or not. The default value is false. -
autostart
Takes the value of 'true' or 'false' to specify if the file should start playing automatically or not. The default value is false. -
loop
Takes the value of 'true' or 'false' to specify if the file should loop continuously or not. The default value is false. -
playcount
Takes a numeric value signifying how many times the file should play. -
volume
Takes a numeric value between 0 - 100 signifying the loudness of the file playing.
Playing a sound with <embed>:
<embed src="/sounds/chords.wav" autostart="false" width="100" height="100" playcount="2" volume="20" />
Output:
Playing a video with <embed>:
You can play video files with the extensions .swf, .avi, .mov, and .mpeg using the <embed> tag.
-
.swf - files with this extension are created using Macromedia Flash (Now Adobe Flash).
-
.wmv - files with this extension are part of Windows Media Video.
-
.mov - files with this extension are part of Apple's Quick Time Movie Format.
-
.mpeg - files with this extension are the standard for compressed movie files. Created by the Moving Pictures Expert Group.
Example:
<embed src="http://www.youtube.com/v/VNj6VFaLCd0&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="250" height="400" autostart="false" volume="20" />
Output:




