What is HTML autoplay Attribute?

HTML, HTML Attributes , 0 Comments

The autoplay attribute is a boolean attribute and it makes sure that the audio or video will play automatically as soon as possible without stopping.

Tag Support

You can use this attribute on audio and video HTML tags.

Audio Tag Example

<audio controls autoplay>
  <source src="dog.ogg" type="audio/ogg">
  <source src="dog.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>

Video Tag Example

<video controls autoplay>
  <source src="myMovie.mp4" type="video/mp4">
  <source src="myMovie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

Browser Support

Element
audio4.09.03.54.010.5
video4.09.03.54.010.5

Spread the love

Leave a Reply

avatar
  Subscribe  
Notify of