
So you know how to embed a YouTube video onto your site right? Well good for you! Copy and paste the code YouTube gives you, easy enough. But what if you want to set the video to autoplay? What I mean by that is have it start playing as soon as the user opens your webpage. By default the user would need to click Play on the video to start the play cycle. It’s easy enough to set the video to autoplay however, check out the demo and keep reading for the code.
View Demo
So all you need to do to set the video to autoplay is add the following:
Right at the end of the two URLs in the embed code that you copied from Youtube. So in the demo above, this was the original code:
After I added the above code to the end of the URLs the embed code looked like this:
And now the video will autoplay as soon as somebody opens the webpage.
One Response to “How to set a YouTube video to Autoplay”



Very nice… good post