To embedd video files in any webpage HTML5 introduce new tag <video>.
Before this you need to use any plug-in like Flash to insert audio or video file. But HTML5 introduce this tag with some attributes which help to directly insert video files.
Tag:- <video>
Syntax:-
<video controls=”controls” src=” ” type=” ” <p> </p>> </video>
Example:
<!DOCTYPE HTML> <html> <head> <title> Audio tag</title> </head> <body> <video width = "300" height = "200" controls autoplay> <source src = "/videoone.mp4" type = "video/mp4" /> Your browser does not support the video element. </video> </body> </html>
Attributes
controls:
specifies that video controls such as play, pause, volum etc.
src:
The source of file means where the file stored.
type:
Define the format of the video file, helping the browser determine before hand whether it can decode the file. This leads to faster download and rendering.
p:
Fallback comment. this will display if the user’s browser doesn’t support the video element of the format of the embedded video.
autoplay(a boolean variable):
If specified video will automatically start playing on page loading.
autobuffer(a boolean variable):
If specified video automatically start buffering even automatically palying is not specified
height:
This specifies the height of the video display area.
width:
This specifies the width of the video play area.
poster:
This is an src of any image which will display until the user play or seeks the video.