What is Audio and Video tags in HTML?

·

2 min read

Audio Tag:-

The "audio" tag is an inline element that is used to embed sound files into a web page. Currently, there are three supported file formats for HTML5 audio tag 1.mp3 2.wav 3.ogg

Audio Tag Attributes:-

  1. Controls:- It defines the audio controls which is displayed with Play/Pause buttons.

  2. Autoplay:- It specifies that the audio will start playing as soon as it is ready.

  3. Loop:- It specifies that the audio file will start over again, every time when it is completed.

  4. Muted:- It is used to mute the audio output.

  5. Preload:- It specifies the author's view to upload an audio file when the page loads

  6. Src:- It specifies the source URL of the audio file.

Video Tag:-

It is used to embed a video on a web page. There are three different formats that are commonly supported by web browsers. 1.mp4, 2.ogg, 3.WebM

Attributes of HTML Video Tag:-

  1. Controls:- It defines the video controls which is displayed with Play/Pause buttons.

  2. Height:- It is used to set the height of the video player.

  3. Width:- It is used to set the width of the video player.

  4. Poster:- It specifies the image which is displayed on the screen when the video is not played.

  5. Autoplay:- It specifies that the video will start playing as soon as it is ready.

  6. Loop:- It specifies that the video file will start over again, every time when it is completed.

  7. Muted:- It is used to mute the video output.

  8. Preload:- It specifies the author's view to upload a video file when the page loads.

  9. Src:- It specifies the source URL of the video file.