Video is included in online documents using the HTML < video > element. It could have one or more video sources, which would be indicated by the src property or the source element. All current browsers recognise the < video > element. Not all browsers, however, support the same video file format.
To play a video file on the webpage, we can use the < video> element. The file formats which can be used are MP4, WEBM, OGG. The attributes which can be used with the < video> tag are as follows:
used to add controls to the video like play,pause
used to specify the height of the video player
used to specify the width of the video player
used to play the video as soon as it is executed
used to mute the video
used to play the video repeatedly
used to specify the source url of the file
Video controls, such as play, pause, and volume, are added with the controls attribute.
Always include width and height attributes in your code. The page may flicker while the video loads if the height and width are not specified.
You can use the < source > element to specify other video files for the browser to choose from. The browser will use the first format it recognises.
Only browsers that do not support the < video > element will see the text between the < video > and < /video > tags.
|