![]() |
Definition and UsageThe When present, the audio/video will automatically start playing as soon as it can do so without stopping. Applies toThe
Browser SupportThe
|
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The audio autoplay attribute</h1>
<p>Click on the play button to play a sound:</p>
<audio controls autoplay>
<source src="https://samplelib.com/lib/preview/mp3/sample-3s.mp3" type="audio/ogg">
<source src="https://samplelib.com/lib/preview/mp3/sample-3s.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>
The video autoplay attribute.
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The video autoplay attribute</h1>
<video width="320" height="240" controls autoplay>
<source src="https://www.sample-videos.com/video321/mp4/240/big_buck_bunny_240p_30mb.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>
html autoplay attribute |
How to add An audio file that will automatically start playing | HTML Attribute |
How to add A video that will automatically start playing in HTML Page | HTML Attribute |
Read Full: | HTML Attribute |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Attribute |
Uploaded by: | Admin |
Views: | 84 |
Reffered: https://www.w3schools.com/tags/att_autoplay.asp