How To Set a YouTube Video to Autoplay

How To Set a YouTube Video to Autoplay

You know how to embed a YouTube video onto your site right?  If not, it’s really easy to do. While on YouTube, below the video click on the Share button, click  Embed, then copy and paste the code YouTube gives you.

But what if you want to set the youtube video to autoplay? What I mean by that is to 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, I have made a demo page that shows you exactly how to set a YouTube Video to Autoplay.  Then keep reading for the code below.

Click Here To See It In Action!

YouTube AutoPlay Code:

&autoplay=1

With the code you copied from YouTube, Add the autoplay code right at the end of the two URLs.  In the demo above, this was the original code:

<object width=”560″ height=”349″><param name=”movie” value=”http://www.youtube.com/v/tDgxQkVjjFk?fs=1&hl=en_US&rel=0″></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”http://www.youtube.com/v/tDgxQkVjjFk?fs=1&hl=en_US&rel=0″ type=”application/x-shockwave-flash” width=”560″ height=”349″ allowscriptaccess=”always” allowfullscreen=”true”></embed></object>

After I added the above code to the end of the URLs the embed code looked like this:

<object width=”560″ height=”349″><param name=”movie” value=”http://www.youtube.com/v/tDgxQkVjjFk?fs=1&hl=en_US&rel=0&autoplay=1“></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”http://www.youtube.com/v/tDgxQkVjjFk?fs=1&hl=en_US&rel=0&autoplay=1” type=”application/x-shockwave-flash” width=”560″ height=”349″ allowscriptaccess=”always” allowfullscreen=”true”></embed></object>

And now the video will autoplay as soon as somebody opens the webpage.

4 comments on “How To Set a YouTube Video to Autoplay

  1. Howdy! Someone in my Facebook group shared this website with us so I came to look it over.
    I’m definitely loving the information. I’m book-marking and will be tweeting this to my
    followers! Outstanding blog and fantastic design and style.
    Stacy recently posted..Stacy

Leave a Reply to Stacy Cancel reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge