AUDIO AND VIDEO TAG

Audio:

The audio tag is used to embed sound content in a document, such as music or other audio streams.

The audio tag contains one or more tags with different audio sources. The browser will choose the first source it supports.

The text between the audio tags will only be displayed in browsers that do not support the audio element.

There are three supported audio formats in HTML: MP3, WAV, and OGG.

Attributes:

autoplay - Specifies that the audio will start playing as soon as it is ready.

controls - Specifies that audio controls should be displayed (such as a play/pause button etc)

loop - Specifies that the audio will start over again, every time it is finished.

Example :

<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
motivational speech.
</audio>

Video:

The video tag is used to embed video content in a document, such as a movie clip or other video streams.

The video tag contains one or more source tags with different video sources. The browser will choose the first source it supports.

The text between the video tag will only be displayed in browsers that do not support the video element.

There are three supported video formats in HTML: MP4, WebM, and OGG.

Attributes:

height - Sets the height of the video player

width - Sets the width of the video player

controls - Video controls should be displayed (such as play/pause button etc).

muted - Specifies that the audio output of the video should be muted

Example :

<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>