IMPORTANT UPDATE: There’s an update to this post. Although the codes on this post still apply to the old YouTube embed code, you can now use the newer YouTube embed codes which are HTML5 compatible and can be viewed on mobile Interent devices. You can view the latest update here: 2012 YouTube Embed Codes – Autoplay On and All Other Parameters
Here are some problems I face when embedding YouTube videos on my website.
First, the user has to click on the “play” button for the video to play. People who are new to online video might not even know to how to do that.

Second, at the end of the video, the “related videos” pop up taking your visitor to other sites. In other words, off your site!

So have you ever wanted your embedded YouTube video to automatically play (autoplay) when your page loads? How about turning off the “related video” feature at the end the video?
You’ve come to the right place. After much experimenting, here are all the YouTube embed code variations to get your video just the way you want it. Just replace the video URL with the video you want to embed:
Default YouTube Embed Code:
<object width=”425″ height=”355″><param name=”movie” value=”http://www.youtube.com/v/EBM854BTGL0&autoplay=1″></param><param name=”wmode” value=”transparent”></param><embed src=”http://www.youtube.com/v/EBM854BTGL0&rel=1&border=0″ type=”application/x-shockwave-flash” wmode=”transparent”width=”425″ height=”344″></embed></object>
Code to Autoplay a YouTube Movie:
<embed src=”http://www.youtube.com/v/EBM854BTGL0&autoplay=1″ type=”application/x-shockwave-flash” wmode=”transparent” width=”425″ height=”344″></embed>
Code to turn off RELATED MOVIES at the end of the movie
<embed src=”http://www.youtube.com/v/EBM854BTGL0&rel=0&border=0″ width=”425″ height=”344″ type=”application/x-shockwave-flash” wmode=”transparent”></embed>
Code to Autoplay YouTube Movie AND turn OFF related movies at the end of the movie:
<embed src=”http://www.youtube.com/v/EBM854BTGL0&autoplay=1&rel=0″ type=”application/x-shockwave-flash” wmode=”transparent” width=”425″ height=”344″></embed>
Want to see what it looks like? Click on the image below to see a live example of the codes in action.

Click on this link to get the codes and view the live example.
Enjoy.
What’s Next?
How about creating custom YouTube backgrounds to brand yourself? Check out the matching themes I use for my blog, Twitter, Facebook Fan Page and YouTube Channel at PersonalBrandingThemes.com
You May Also Like These Related Posts:
Tags: autoplay, embed, related video, youtube






Leave A Reply (80 comments So Far)
Omar Lee
256 days ago
Hi Brian, Great article here. I was wondering if is there anyway we can disable double click that goes to youtube site.
Using the code below will not get you to youtube site when you double click it, it will just go fullscreen.
But using the code below, will get you to youtube if you double click it. (new default embed code)
The option i see with their difference was this:
http://www.youtube.com/embed/4rkHMxrj-p0 and
http://www.youtube.com/v/4rkHMxrj-p0
and you cannot add the option autoplay=1&hl=en&fs=1&rel=0 to this option
http://www.youtube.com/embed/4rkHMxrj-p0 to become
http://www.youtube.com/embed/4rkHMxrj-p0&hl&hl=en&fs=1&autoplay=1&hl=en&fs=1&rel=0
I just want to know how to add autoplay and turn off the related videos using this option
http://www.youtube.com/embed/4rkHMxrj-p0
or disable the double click command that goes to youtube site or just make it full screen instead of going to youtube site.
http://www.youtube.com/embed/4rkHMxrj-p0 to become
http://www.youtube.com/embed/4rkHMxrj-p0&hl&hl=en&fs=1&autoplay=1&hl=en&fs=1&rel=0
I wonder if there is an option like that. Sorry for my long comments. Just make sure my point is surely understood.
Thanks.
Omar Lee
256 days ago
Using the code below will not get you to youtube site when you double click it, it will just go fullscreen. (new default embed code)
But using the code below, will get you to youtube if you double click it.
Omar Lee
256 days ago
i thought i forgot to paste the code, but i just knew the code was disabled by wordpress
Sorry. my comment looks spam..coz it has become many comments.
ron
233 days ago
hey this code aint working any more wats going on
Remote Backup Business
218 days ago
This code doesn’t work anymore ;-(
Ashley
205 days ago
You’re the man, thanks just what I was looking for.
Burhan
202 days ago
this old code doesnt work anymore. Actually, you will have to use the “?” instead of “&” for your first parameter only. If you use more than one parameter, you will then have to add “&” to the chain.
for any problem, just email me at burhangullu@hotmail.com
Beth
202 days ago
This is fantastic! Thank you. I’ve bookmarked it so I can just refer to this every time I post a video. So handy!
Bail Bond
187 days ago
Thanks Brian, I have been trying multiple codes for my website and none seem to work. I placed this code in and Viola! Working Great!
Thank You
Rudy
187 days ago
Since youtube has updated there embed code to an iframe now I was searching online to see how to make a playlist I made for my site to auto play when the page loads. Youtube doesn’t offer to much in the way of embedding options now. I came across this site when I was trying to figure out how to get it to auto play but this post has the old embed codes so I thought I would share how to get your videos or playlist to auto play since even on the youtube help section which was updated feb 2, 2011 I believe is not up to date with the new iframe code.
Eample of current iframe code (playlist):
After playing around with the “play in HD” check box option I notice a small bit of extra coded added to the end of the URL which was ” &hd=1 ” So I figured if I changed the [ &hd=1 ] to [ &autoplay=1 ] at the end of the URL it would make the video start by its self once the web page loaded which it did work :)
Example of current iframe code with auto play:
I have a live example of this on my website in the side bar of the site. Just click on my name to the left if you want to see how the video auto plays now. Also you can change the size of the video right in the script if the size options don’t work for you on youtube as they didn’t for me. Hope this helps anyone with the same problem I had cause I never did find the answer after search for over an hour online for such a simple option. :)
Rudy
187 days ago
Just thought since this post talks about how to make the old embed code loop I figured I would put the iframe code to make it loop as well.
Example with auto starting and looping:
added &autoplay=1&loop=1 at the end of the youtube URL
code [ ]
Cynthia
172 days ago
Very helpful! Thanks Brian!
Vincent Kernaghan
154 days ago
I spent hours trying different things until I found this page which helped me figure it out in 5 minutes. With the latest changes from YouTube, this is the code that works for me on both IE and Firefox. It gets inserted immediately after the URL, before the closing ”
?rel=0&frameborder=0&autoplay=1
Like Burhan points out earlier above, it now needs to start with the ? and use the & repeatedly. I did it with no spaces between the parameters.
The full code looks like this:
Thank you, thank you, thank you!
trevon
152 days ago
hi can i ask?
bout the play button then if you click the button there is embed video auto play…
something like this
http://www.dropbox.com/
hope you help me..
DeniE.
147 days ago
Hi Brian!
I was suffering with a video all day, until I found your site and quickly solved all my doubts. Thank you so much … I’m doing my first blog
http://thevirtualparadise.blogspot.com/
and you really helped me a lot. Saúdos!
libertytaken
142 days ago
Thanks Brian!!! This is very helpful. I applied it to my website called Liberty Taken – libertytaken.com. More helpful tips.
arief
131 days ago
thanks Brian!
old post but it help me much taking care my videos.
ed
116 days ago
thanks Brian! i had alot of problems with this this really helped me out alot
nick
100 days ago
doesn’t seem to work for me…any ideas?
Ryan
87 days ago
Thanks for the info, still applicable in 2012 with new format.
Brian Wong
85 days ago
IMPORTANT UPDATE: There’s an update to this post. Although the codes on this post still apply to the old YouTube embed code, you can now use the newer YouTube embed codes which are HTML5 compatible and can be viewed on mobile Interent devices. You can view the latest update here: 2012 YouTube Embed Codes – Autoplay On and All Other Parameters
OhGreat
81 days ago
Auto playing videos on your website is the fastest way to make people leave. Please don’t encourage autoplaying, it’s annoying as hell…
gianni
77 days ago
Guys just use vimeo it sets these settigns as default and auto-generates a perfect code each time
ken free TGR
42 days ago
The Auto play of youtube videos will no longer work following the code &autoplay=1
Rick
37 days ago
Excellent, thanks so much. Very helpful.
Brian Wong
36 days ago
Yes, I’ve updated this with the new embed codes here: http://brianwong.com/blog/2012-youtube-embed-code-autoplay-on-and-all-other-parameters/
MIke Butler
27 days ago
Awesome! Awesome! – Thank you! thank you!
that’s it in a nutsell