Write HTML codes to attach video on webpage using embed tag in html || DWPD Sem 5 Practical 2

HTML - Video

DWPD: Practical 2

There are two ways to attach video files to an HTML page. The first way would be using the <embed/> tag and <video/> tag. The embed tag does not need an ending/finishing tag. It works, mostly, the same as a tag for a photo.


PRACTICAL CODE<embed src="example.mpeg" autostart="false" height="30" width="144" />

 Supported extensions of the embed tag

  • .swf - made by Macromedia Flash
  • .wmv - Microsoft Windows Media Video
  • .mov - Quick Time Movie, belongs to Apple
  • .mpeg - created by Moving Pictures Expert Group.
The .mpeg and .swf are mostly used formats because of the compact format.

Attributes of the embed tag

  • autostart - sets whether the file will run automatically after the page is loaded. Can have the true or false value
  • hidden - sets whether the buttons are hidden or not. Can have the true or false value.
  • volume - can have any value from 0 to 100
  • loop- sets whether the file will be replayed after it is finished. Can have the true or false value.
  • playcount - this establishes how many times the file will be replayed. For example playcount="2" means it will be replayed two times and after it will stop.

practical code<!DOCTYPE html>
<html>
<head>
<title>video using <embed> tag</title>
</head>
<body>
<embed src="https://www.youtube.com/watch?v=G5i6FjRailE" height="200px" width="300px" />
</body>
</html>


Output :



Comments