Welcome to our blog-Techwalebnde, In today's blog we will learn about audio and video tags which are used in html So lets start....
What is Audio tag?
In simple words audio content can be easily embed into Webpage using <audio> tag in html,
Syntax:
Attributes:
· Src: This attribute specifies the URL or path to the audio file you want to embed.
- Controls: When this attribute is present, it adds basic controls to the audio player, such as play, pause, and volume adjustment. Users can interact with these controls to manage playback.
· Autoplay: If this attribute is included, the audio will start playing automatically when the webpage loads.
· Loop: When set, this attribute causes the audio to repeat playing once it reaches the end.
· Preload: Specifies if and how the audio should be loaded when the page loads..
Values of Preload attribute:
a. preload="auto": This is the default behavior. It tells the browser to preload the entire audio file as much as possible.
b. preload="metadata": This option tells the browser to preload only the metadata (information about the audio file, such as duration and track information) without loading the actual audio content.
c. preload="none": This option instructs the browser not to preload the audio file at all.
· Muted: When included, this attribute mutes the audio initially.
· Volume: This attribute sets the initial volume level of the audio. It ranges from 0.0 (silence) to 1.0 (maximum volume).
· Type:
Specifies the MIME type of the audio file, such as audio/mpeg for MP3 files or audio/wav for WAV files. It helps the
browser understand how to handle the audio content.
What is Video tag?
The <video>
tag in HTML is used to embed videos directly into a web page. It lets you play
a video file right in the browser, similar to how you watch videos on YouTube or
other video platforms. The <video> tag can control aspects like play,
pause, volume, and even add subtitles or captions to make the video more
accessible....
Syntax:
Attributes:
- Src: Specifies the path of the video file.
- Controls: Adds video controls like play, pause and volume.
- Autoplay: Automatically starts playing the video when the page loads.
- Loop: Repeat the video once it ends.
- Muted: Mutes the video by default.
- Poster: Specifies the image to be displayed before the video starts playing.
- Width and height: Specifies the dimensions of the video..
- Here are the link of html cheatsheet...
- Here are the link for basic html guide...
- Here are the link for basic html elements...

0 Comments