html tutorial - <video> Video Tag in HTML - html5 - html code - html form
- The <video> element specifies the video streams or movie clips.
- There are three supported formats for video tag they are Mp4, WebM and Ogg.
- <video> tag belongs to Phrasing Content, Flow Content, Embedded Content Category.
Syntax for <video> tag:
Differences between HTML 4.01 and HTML 5 for <video> tag:
- HTML4 does not supports <video> tag.
- The <video> tag is new in HTML5.
Sample Coding for <video> tag:
Code Explanation for <video> tag:
- <video> tag will display the movie clip.
- <source> tag used to define the source video file.
Output for <video> tag:
- Here the video is displayed in the HTML document.
|autoplay||autoplay||No||Yes||The video will automatically start playing as soon as it is ready.|
|controls||controls||No||Yes||The video controls specifies that the video should be displayed.|
|height||pixel||No||Yes||It is used to set the height of the video player in pixel.|
|loop||loop||No||Yes||A video will start over again, every time it is finished.|
|muted||muted||No||Yes||It is used to specifies the audio output of the video should be muted.|
|poster||URL||No||Yes||It is used to specifies an image to be shown until the user hits the play button.|
|No||Yes||It is used to specifies that how the author thinks that the video should be loaded when the page loads. It is ignored when autoplay is present.|
|src||URL||No||Yes||It is used to specifies that the location of the video file.|
|width||pixels||No||Yes||It is used to set the width of the video player in pixel.|
Browser Support for <video> tag: