Video Tag


Prev Tutorial Next Tutorial

Video Tag in HTML5

<video>tag are used to add video on web page. Html5 added new tag for add video files on web page, befor html5 it is achieve by using <embed> tag

Attributes of meter

  • mp4
  • webM
  • ogg

Browser supported

video formats
mp4YesYesYesNoYes
webMYesYesNoYesNo
oggYesYesNoYesNo

Example

	
<!DOCTYPE html>
<html>
<body>

<video controls>
<source src="/html5/images/movie.mp4" type="video/mp4">
</video>

</body>
</html>

Result

Attributes of Video Tag

AtrributeDescription
controlsUsed to defines the video controls which is displayed with play/pause buttons.
heightUsed to set the height of the video player.
widthUsed to set the width of the video player.
posterUsed to specifies the image which is displayed on the screen when the video is not played.
autoplayUsed to specifies that the video will start playing as soon as it is ready.
loopUsed to specifies that the video file will start over again, every time when it is completed.
mutedUsed to mute the video output.
preloadUsed to specifies the author view to upload video file when the page loads.
srcUsed to specifies the source URL of the video file.

Html Video Tag media type

File FormatMedia Type
MP4video/mp4
WebMvideo/webm
Oggvideo/ogg

Browser supported

Element
<video>YesYesYesYesYes

Prev Tutorial Next Tutorial

Advertisements




Download Projects