Sunday, 24 July 2016

HTML Audio, Video, Embed, Object Element

HTML Audio Element
This element is used to insert audio on a web page. You can play the audio on your web page using this element.The text between the starting and ending tags is the alternate text for the browser that does not support  this element.
Attributes of Audio Element
  • autoplay- plays the audio as soon as the Web page loads.
  • controls- displays the controls on the web page such as play button.
  • loop- replays the audio file
  • preload- specifies whether the audio file is preloaded on the web page or not.
  • src- specifies the location of the audio file.
ex: 
<!Doctype Html>
<html>
<body>
<h1>Audio</1>
<audio src="hamariadhurikahani.mp3" controls autoplay="true">
Your Browser does not support audio element
</audio>
</body>
</html>


HTML Video Element
This element is used to insert video file on a web page.The text between the starting and ending tags is the alternate text for the browser that does not support  this element.
Attributes of Video element
  • autoplay- plays the audio as soon as the Web page loads.
  • controls- displays the controls on the web page such as play button.
  • loop- replays the audio file
  • preload- specifies whether the audio file is preloaded on the web page or not.
  • src- specifies the location of the video file.
  • height- specifies the height of the video file.
  • poster- provides an image to be displayed when the video file is not available.
  • width- specifies the width of the video file.
Example:
 <!Doctype Html>
<html>
<body>
<h1>Video</1>
<video src="jeena.mkv" controls >
Your Browser does not support video element
</audio>
</body>
</html>


HTML Embed Element
Allows you to embed multimedia and plug-ins on a webpage.
src, height and width are the mandatory attributes of the embed element.
Attributes of Embed Element
  • height- specifies the height of the embedded object.
  • src- specifies the location of the file.
  • width- specifies the width of the embedded object.
  • type- specifies the multipurpose internet mail extension type for the component.
  • hspace- sets the horizontal padding around the object.
example: 
<!Doctype Html>
<html>
<body>
<h1>Video</1>
<embed src="jeena.mkv" width="200" height="200" >
</embed>
</body>
</html>

HTML Object Element
This element is used to include object such as Images, Videos, Audios, Java applets, Active X Controls, PDF, flash objects in a web page.
The text between the starting and ending tags is the alternate text for the browser that does not support  this element.
Attributes of Object element
  • height- specifies the height of the object.
  • width- specifies the width of the object.
  • type- specifies the multipurpose internet mail extension type for the component.
  • data- specifies the url of the object data.
  • form- specifies the one or more form to which this object belongs.
  • name- specifies the object name,
  • usemap- specifies the url.
example:
<!Doctype Html>
<html>
<body>
<h1>Video</1>
<object data="jeena.mkv" type="video/mkv" width="200" height="200" >
Your Browser does not support Object element />
</object>
</body>
</html>

0 comments:

Post a Comment