Menu
Coddy logo textTech

Autoplay

Lesson 4 of 7 in Coddy's YouTube Video Player - HTML Project course.

It's possible to let your video start playing automatically when a user visits the page, to do so, add the autoplay=1 query parameter.

https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1

To combine multiple query properties separate them with &:

https://www.youtube.com/embed/dQw4w9WgXcQ?mute=1&autoplay=1

In some browsers, auto playing without muting the video is not allowed!

challenge icon

Challenge

Easy

Make your video also auto play.

Don't remove it's mute!

Try it yourself

<!DOCTYPE html>
<html>
    <body>
        <iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ?mute=1">
        </iframe>
    </body>
</html>

All lessons in YouTube Video Player - HTML Project