Horje
How does the <audio> Element work in HTML5?

HTML5 introduces the <audio> element, providing native support for embedding audio content directly into web pages. This element offers a seamless and better way to include audio files without relying on third-party plugins.

Syntax

<audio>
<source src="sample.mp3" type="audio/mpeg">
</audio>

Supported Audio Formats

HTML5 <audio> supports various audio file formats, such as MP3, WAV, and Ogg. This compatibility ensures that your audio content can be played across different browsers and platforms.

Attributes for Customization

Attribute Description
autoplay Starts playing the audio automatically when the page loads.
loop Loops the audio playback, allowing it to repeat continuously.
preload Specifies whether the audio should be loaded when the page loads. Options include none, metadata, and auto.
controls Designates what controls to display with the audio player. If present, the audio player includes playback controls.
muted Designates that the audio file should be muted by default when loaded.



Reffered: https://www.geeksforgeeks.org


HTML

Related
How to implement the Forms in HTML ? How to implement the Forms in HTML ?
Latest Version of HTML Latest Version of HTML
How to use &lt;ul&gt; Tag in HTML ? How to use &lt;ul&gt; Tag in HTML ?
What is the difference between the &lt;br&gt; Tag and the &lt;p&gt; Tag ? What is the difference between the &lt;br&gt; Tag and the &lt;p&gt; Tag ?
What is the purpose of the alt attribute in the &lt;img&gt; Tag ? What is the purpose of the alt attribute in the &lt;img&gt; Tag ?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
10