YouTube Embed Code Options – Autoplay On or Off

YouTube Embed Code - Autoplay

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.

play YouTube Embed Code Options   Autoplay On or Off

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

related videos YouTube Embed Code Options   Autoplay On or Off

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.

picture 4 YouTube Embed Code Options   Autoplay On or Off
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

If you enjoyed this post, please also subscribe to my RSS feed! You can also follow me on Twitter here.

Tags: , , ,

Leave A Reply (90 comments So Far)


  1. Omar Lee
    2 years 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.


  2. Omar Lee
    2 years 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.


  3. Omar Lee
    2 years 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.


  4. ron
    2 years ago

    hey this code aint working any more wats going on

  5. This code doesn’t work anymore ;-(


  6. Ashley
    2 years ago

    You’re the man, thanks just what I was looking for.


  7. Burhan
    2 years 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


  8. Beth
    2 years 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!


  9. Bail Bond
    2 years 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


  10. Rudy
    2 years 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. :)


  11. Rudy
    2 years 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 [ ]


  12. Cynthia
    2 years ago

    Very helpful! Thanks Brian!


  13. Vincent Kernaghan
    2 years 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!


  14. trevon
    2 years 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..


  15. DeniE.
    2 years 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!


  16. libertytaken
    2 years ago

    Thanks Brian!!! This is very helpful. I applied it to my website called Liberty Taken – libertytaken.com. More helpful tips.


  17. arief
    2 years ago

    thanks Brian!
    old post but it help me much taking care my videos.


  18. ed
    2 years ago

    thanks Brian! i had alot of problems with this this really helped me out alot


  19. nick
    2 years ago

    doesn’t seem to work for me…any ideas?


  20. Ryan
    2 years ago

    Thanks for the info, still applicable in 2012 with new format.


  21. Brian Wong
    2 years 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


  22. OhGreat
    2 years 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…


  23. gianni
    2 years ago

    Guys just use vimeo it sets these settigns as default and auto-generates a perfect code each time


  24. ken free TGR
    2 years ago

    The Auto play of youtube videos will no longer work following the code &autoplay=1


  25. Rick
    2 years ago

    Excellent, thanks so much. Very helpful.


  26. Brian Wong
    2 years 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/


  27. MIke Butler
    2 years ago

    Awesome! Awesome! – Thank you! thank you!

    that’s it in a nutsell


  28. L. Holland
    2 years ago

    Hi,

    I just wanted to thank you very very much for these codes. The autoplay code worked like magic. I truly appreciate your assistance! Have a great day :-)

    -L. Holland


  29. Derrek
    2 years ago

    dousnt work anymore.. :(


  30. Alex
    2 years ago

    I tried to add the autoplay code like this:

    Original code:
    [youtube http://www.youtube.com/watch?v=cljAro3k84U&w=420&h=315

    New code:
    [youtube http://www.youtube.com/watch?v=cljAro3k84U&autoplay=1&w=420&h=315

    But this rendered the video unplayable. It just was a black box in the page.
    I also tried to add the code: &rel=0 either together and seperately to the iframe code with the same results.

    Can you give me a hint as to why this does not work for me?
    The framework my site is in is Magento go ecommerce – if this helps at all.
    thanx very much in advance for your help


  31. hasnain
    1 year ago

    Thank you so much for the info. It was a great help.


  32. Sylvia
    1 year ago

    don’t see where it tells how to turn auto play “off” like the post heading suggests

    maybe I missed it


  33. Brian Wong
    1 year ago

    By default, autoplay is off. So you would just use the normal youtube code.


  34. Jimmy Shine
    1 year ago

    I have two youtube auto play videos on my site 1 in the Solavei menu and one in the Blog menu. They work fine for computers but do not auto play for smart phones. Is there a way to make them auto play for phones like they do for computers. Most people will not click the start button to play the video.

    Thanks Respectfully,

    Jimmy Shine


  35. Herman
    1 year ago

    Hi Brian and Hi everyone. I need your help. I need to embed videos on my website for members in a protected area. I know that screencast.com does this but I have to pay for it. Is it possible to do it with Youtube.
    Thanks


  36. Brian Wong
    1 year ago

    You can try setting the privacy of your youtube video to “unlisted”. For videos in membership sites, I prefer to host them on Amazon S3 to secure them and it only costs a few cents each month to maintain.


  37. Brad Twersky
    1 year ago

    Hi Brian…does the code you wrote above have to be inserted into the pre-existing YouTube code somewhere or does it substitute what YouTube gives you? Because I tried substituting it and changed the numbers for the video and even the placeholder is missing. Can’t figure out what I did wrong…

    http://www.premiumlocalexposure.com/indexincase.html

Search This Site


bettergoals app

Brian Wong on Facebook

About Brian Wong

Brian Wong is a serial entrepreneur, life explorer and father of two. Over the last ten years, he has founded successful businesses in several areas including the health and wellness industry, in property investment and in online information marketing.

Read More About Brian Wong...

Connect With Brian

Blog Archives