Autoplay video HTML 5

Autoplay video in HTML 5

Posted by Ervin Adams on July 30, 2022

Autoplay video HTML 5

Autoplay video in HTML 5

Posted by Ervin Adams on July 30, 2022

You can use the autoplay attribute to play a video automatically in HTML 5

  • Place the autoplay attribute within the video element
  • Once the browser loads the page the video will start playing automatically 
  • If you want the video to autoplay without sound, add the muted attribute also
  • If you don't want the user to have control while autoplay, do not put controls attribute

Here is an example:

HTML autoplay video 

<video width="712" height="374" autoplay muted>
   <source src="/videos/sample.webm" type="video/webm">
</video>