HTML Video Tag
By Saket Bhatnagar••Beginner to Intermediate
video tag
- 1The <video> tag was introduced in HTML5.
- 2The <video> tag is used to embed or attach video to a web page.
- 3It is a container tag.
- 4It is block level element.
- 5To mention the path of video we have to use <source> tag(Source tag is a non container tag.)
- 6In <source> tag we have to use 'src' attribute in which path of video will be provided.(Syntax:- <source src='path-of-video'>
- 7We can provide multiple sources using multiple <source> tags.
- 8The content written within <video> tag will be displayed when <video> tag is not supported by the browser.
- 9Syntax:- <video> <source src='path-of-video'> <source src='path-of-video'> Video tag is not supported by the browser. </video>
Attributes of video tag
- 1Controls :- It is used to enable the controls of the video like play,pause,volume control, etc.
- 2Autoplay :- It is used to automatically play the video when the page is loaded.
- 3Loop :- It is used to play the video continuously in a loop i.e, when the video ends it is started again automatically.
- 4Muted :- It is used to mute the audio of video.
- 5Poster :- It is used to apply cover image or technically called as poster to the video before the video plays.
- 6Width :- It is used to specify the width of the video element.
- 7Height :- It is used to specify the height of the video element.