@kadilakshmi59
Here I will attach answer for your query which you have posted on MS Teams.
Please refer to this.
Have a Happy Learning!
@kadilakshmi59
Here I will attach answer for your query which you have posted on MS Teams.
Please refer to this.
Have a Happy Learning!
A. The HTML < video > Element
< video width=“320” height=“240” controls >
< source src="movie.mp4" type="video/mp4" >
< source src="movie.ogg" type="video/ogg" >
< /video >
The controls attribute adds video controls, like play, pause, and volume.
It is a good idea to always include width and height attributes. If height and width are not set, the page might flicker while the video loads.
The < source > element allows you to specify alternative video files which the browser may choose from. The browser will use the first recognized format.
The text between the < video > and < /video > tags will only be displayed in browsers that do not support the < video > element.
To start a video automatically, use the autoplay attribute:
< video width=“320” height=“240” autoplay >
< source src="movie.mp4" type="video/mp4" >
< source src="movie.ogg" type="video/ogg" >
< /video >
< video width=“320” height=“240” autoplay muted >
< source src="movie.mp4" type="video/mp4" >
< source src="movie.ogg" type="video/ogg" >
< /video >
B. The HTML < audio > Element
1.To play an audio file in HTML, use the < audio > element:
Example
< audio controls >
< source src="horse.ogg" type="audio/ogg" >
< source src="horse.mp3" type="audio/mpeg" >
< /audio >
The controls attribute adds audio controls, like play, pause, and volume.
The < source > element allows you to specify alternative audio files which the browser may choose from. The browser will use the first recognized format.
The text between the < audio > and < /audio > tags will only be displayed in browsers that do not support the < audio > element.
2.To start an audio file automatically, use the autoplay attribute:
< audio controls autoplay >
< source src="horse.ogg" type="audio/ogg" >
< source src="horse.mp3" type="audio/mpeg" >
< /audio >
< audio controls autoplay muted >
< source src="horse.ogg" type="audio/ogg" >
< source src="horse.mp3" type="audio/mpeg" >
< /audio >