Login | Contact Us | Site Map | Resources

Other HTML Elements

Home > HTML Tutorial > HTML Video Codes

HTML Video Codes

HTML provides the <embed> tag as a method of embedding a video in your HTML file. It is an empty element, meaning that it does not have a closing tag.

The "src", or source attribute points to the location and name of the file that is to be embedded. The file types supported by this element are AVI (.avi), MOV (.mov), MPEG (.mpeg) and flash (.swf).

<embed src="http://www.phpforkids.com/videos/file-name.mp3" />

Several additional attributes are available.

autostart="true"   Causes the Video to Play When Page Is Fully Loaded
autostart="false"   Prevents the Video From Playing Until "Play" Is Pressed
hidden="true"   Hides the Play/Pause/Stop Controls
hidden="false"   Shows the Play/Pause/Stop Controls
loop="true"   Loops/Repeats the Video Continuously
loop="false"   Loops/Repeats the Video Once
playcount="5"   Loops/Repeats the Video As Many Times As Indicated By Value
volume=""   Numeric Value (0-100) Controls the Starting Volume


YouTube make your job easier by providing a line of code for each video (as long as the owner of the video allows this feature) that you can copy and paste directly into your HTML document, without modifying, in order to embed a video on your webpage.

Now you can add as many cute little puppy and kitten videos to your site as you want!