<h2>Audio Tag in HTML</h2>
The audio tag is used to play an audio file
like mp3, ogg and wav files.
The audio tag has many attributes like controls, autoplay,
loop, muted, src, preload.
You can use this type of audio file in your website,
so you should be used the type format in source tag.
Type Format
MP3 audio/mpeg
Ogg audio/ogg
Wav audio/wav
Here are some examples:
Audio tag with controls attribute:
<audio controls>
<source src="abc.mp3" type="audio/mpeg">
</audio>
Controls Attribute:
Without controls attribute you cannot be seeing the
audio player mean you can’t be play, pause, stop, increase or
decrease volume without controls option.
Autoplay Attribute:
Autoplay attribute automatically playing your audio file.
<audio controls autoplay>
<source src="abc.mp3" type="audio/mpeg">
</audio>
<h2>Video Tag in HTML</h2>
The video tag is used to play a video in your website.
Video tag supports three types format:
Type Format
MP4 video/mp4
WebM video/webm
Ogg video/ogg
Example:
<video width="320" height="240" controls>
<source src="feedback.mp4" type="video/mp4">
</video>