autoplay video javascript code example
Example 1: html video autoplay IPHONE
<video autoplay loop muted playsinline class="video-background">
<source src="videos/intro-video3.mp4" type="video/mp4">
</video>
Example 2: html video autoplay
Syntax:
<video autoplay>
Example:
<video controls autoplay>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
</video>
Example 3: autoplay youtube video
// Add this to your URL
?autoplay=1&mute=1
// example
https://www.youtube.com/embed/9QTojZVR_Ec?autoplay=1&mute=1
Example 4: html video autoplay
<!DOCTYPE html>
<html>
<body>
<h1>The video autoplay attribute</h1>
<video width="320" height="240" controls autoplay>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>