YouTube embed options can make your videos look less YouTube-y

YouTube embed options Photo: Handicam Credit: Sanja Gjenero

YouTube embed options are a great way to get a more professional look from your embedded videos.  The trick is to understand what codes to use and how to insert them into YouTube’s embed code. YouTube doesn’t make it so simple to do, though.  This is a short tutorial to go over some of my favorite options to personalize your embedded video.

This post was inspired in part by Ellen Bremen’s wonderful video post yesterday (if you haven’t seen it you need to check it out).  My intention was to make the video play automatically, to take away all of the visible bars and controls, and to hide suggested videos after the video completes.  So here’s how I went about it:

YouTube embed options: how to find the basic embed code

Once you have a video hosted on YouTube that you want to embed on your site, you simply have to push “share” and “embed” to get the basic embed code (see the arrow in the illustration).

YouTube Embed Options

YouTube embed options: How to customize your embedded video

The key to this is to understand where to input the additional code and what your options are.  YouTube gives you a rundown of all of your options on their developer site. I’ll discuss a few popular ones at the beginning of the post and later will go through the litany of YouTube embed options with visual examples for each.

The “autoplay” function allows for a video to immediately start when a page loads.  (the value “1” enables this).  To insert this into the embed code, you would simply use the “?” character and then “autoplay=1″

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/usi8OvRSGs0?autoplay=1” frameborder=”0″ allowfullscreen>iframe>

The “controls” function allows you to hide or show the video controls.  To hide the controls, I insert the character “&” and then “controls=0″ immediately after the last code entered.

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/usi8OvRSGs0?autoplay=1&controls=0” frameborder=”0″ allowfullscreen>iframe>

The “showinfo” code shows and hides the YouTube header bar.  To hide the info bar, I insert the character “&” and “showinfo=0″

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/usi8OvRSGs0?autoplay=1&controls=0&showinfo=0” frameborder=”0″ allowfullscreen>iframe>

Finally, in order to remove related videos from the end of the video I insert “&” then “rel=0″ like this:

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/usi8OvRSGs0?autoplay=1&controls=0&showinfo=0&rel=0” frameborder=”0″ allowfullscreen>iframe>

What does each YouTube embed parameter look like?

To take this post a step further, I thought it might be helpful to go through each of the embed options and visually show what each addition would do. For your reference, you can find a definitive list of parameters that you can control for an embedded  YouTube video: https://developers.google.com/youtube/player_parameters?csw=1. It’s important to note that there are settings specific to Flash players (you can get these embed codes by checking the box for “get old embed code” when getting the embed code for any specific YouTube video), and HTML5. For the purposes of this post, all embed codes are HTML5 compliant (mobile devices won’t display Flash making HTML5 a better solution for most purposes).

So I’m going to use the Rick Astley “Never Gonna Give You Up” video (aka the “Rick Roll”) as our example video. So, here is the default embed from YouTube:

***Update 4/30/2014 – since Rick Astley has evidently take down his video from YouTube, I substituted his video with a video of professional wrestler Stone Cold Stone Austin lip-syncing to the song. It’s not the original but it will do.

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk” frameborder=”0″ allowfullscreen>


Autohide

Now we’ll add “autohide.” Autohide has three values, “2” which is the default and video progress bar to fade out while the player controls remain visible, “1” which hides the progress bar and player controls after a few seconds, and “0” which will keep the progress bar and player controls visible always. In this embed, the autohide value is set to “1.” The difference may or may not be especially distinguishable.

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?autohide=1″ frameborder=”0″ allowfullscreen>iframe>


Autoplay

I discuss autoplay above and for the sake of your sanity I have omitted an example of this. Trust me, it works.

cc_load_policy

This allows you to turn closed captions on, even if the user has them turned off by default. The “0” value turns closed-captions off, and the “1” value turns closed-captions on. (For this example we’ll use a different video since Rick Astley’s video is disappointingly not closed captioned)

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/g5t1r7yG7rM?cc_load_policy=1″ frameborder=”0″ allowfullscreen>iframe>


color

The color parameter dictates the color that the progress bar shows on the video. There are two parameters to choose from: “red” and “white.” Red is the default, so here is an example of the “white” parameter:

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?color=white” frameborder=”0″ allowfullscreen>


controls

The controls parameter determines when the controls will display. The “0” setting will prevent controls from showing, the “1” setting is the default and shows controls, and the “2” setting is the same as “1” except that Flash isn’t loaded until the player plays. Here is an example of the “0” setting:

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?controls=0″ frameborder=”0″ allowfullscreen>iframe>


disablekb

The disablekb parameter will disable the keyboard controls. This parameter value is “0” by default, but can be changed to “1” to disable the keyboard controls.

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?disablekb=1″ frameborder=”0″ allowfullscreen>

I haven’t included an embed option as it doesn’t do anything visually to the video. Incidentally, YouTube keyboard controls are as follows:

Spacebar:  Play / Pause
Arrow Left:  Jump back 10% in the current video
Arrow Right:  Jump ahead 10% in the current video
Arrow Up:  Volume up
Arrow Down:  Volume Down

enablejsapi

The enablejsapi allows you to enable the Javascript API to control the YouTube player. If you need this parameter (which is “1” to enable and “0” by default incidentally), stop reading this post – you probably don’t need it. :)

end

The “end” parameter enables you to determine a duration (in seconds) that your video will play and then conclude. Note that the time is from the beginning of the video and not from the complementary “start” parameter that I’ll discuss in a moment. Note that YouTube says this doesn’t work for HTML5, but it appears to be working in this two-second example:

<iframe src=”http://www.youtube.com/embed/yp9pTFcD2uk?end=2” height=”480″ width=”640″ allowfullscreen=”” frameborder=”0″></iframe>


fs

The fs (fullscreen) parameter is another embed parameter that doesn’t work with HTML5. It allows you to hide the fullscreen button. It is set to “1” (display) by default, but can be set to “0.”

iv_load_policy

The parameter “iv_load_policy” determines whether or not video annotations will be shown. There are two values: “1” and “3,” where “1” (the default setting) shows video annotations and “3” does not. Fortunately, the Astley video has some annotations so you can see the difference between the two. Here is an example where video annotations aren’t shown:

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?iv_load_policy=3” frameborder=”0″ allowfullscreen></iframe>


list and listType

List and listType are Flash-specific commands to determine and control a video playlist. Because the “playlist” command works for HTML5 as well, it’s probably a better tactic to use that parameter to create a playlist so I’ll skip over these.

loop

This setting allows you to set your video to repeat ad infinitum. The “0” value is the default (stop at the end) value, and the “1” value will create a loop. For giggles, I’ll embed the Astley video with loop enabled (though I hope nobody will need to watch it a bunch to find it helpful :) ). You’ll note in the code that in order to make “loop” work it should be used in conjunction with the “playlist” attribute.

<iframe width=”640″ height=”480″ src=”//www.youtube.com/embed/yp9pTFcD2uk?loop=1&playlist=yp9pTFcD2uk” frameborder=”0″ allowfullscreen></iframe>


modestbranding

The modestbranding setting allows you to show your videos without the YouTube logo showing. You’ll notice that the YouTube logo goes away but it’s not as incognito as you might imagine. In any event, the value to turn on “modest branding” is “1.”

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?modestbranding=1” frameborder=”0″ allowfullscreen></iframe>


origin and playerapiid

These two functions are used in conjunction with the Javascript enable. Since I don’t know too much about this aspect of YouTube embeds I’ll skip these for now.

playlist

The playlist function allows you to play a prescribed list of sequential YouTube videos in your embed. It’s pretty simple to use, after the playlist command you list the IDs of the videos that comprise your list each separated by a comma (note that if you mention the first embedded video in the list it will play twice). This is a video list of Rick Astley videos – if you watch carefully you may come to the same conclusion that I have that he was Robin Thicke before Robin Thicke was Robin Thicke…. but I suppose that’s an ad sequitur to the embed option post:

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?playlist=0oicc86PwEM,lq2zHpcLBXI,MkYGDzO_2hs,WepArag_IUc” height=”480″ width=”640″ allowfullscreen=”” frameborder=”0″>


rel

The “rel” parameter determines whether you want to show related videos at the end of your video or playlist. The default is “1” for yes, and conversely the value of “0” will prevent related videos from being shown at the end of the embedded video. Here is an example:

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?rel=0” frameborder=”0″ allowfullscreen></iframe>


showinfo

The showinfo parameter determines whether the video information is presented before the video is played. The “1” value is default, and “0” value hides the video information as such:

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?showinfo=0” frameborder=”0″ allowfullscreen></iframe>


start

The start parameter determines the spot where the video will begin playing (measured in seconds from the beginning of the video). Recall that this can be used in concert with the “end” function, but both parameters are measured in seconds from the beginning of the video. Here is an embed of the Rock Astley video where a bartender does a backflip (102 seconds in):

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?start=102” frameborder=”0″ allowfullscreen></iframe>


theme

The theme parameter allows you to choose either a dark or light theme for your embedded video player. The “dark” value is default, and here is an example of the “light” value:

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?theme=light” frameborder=”0″ allowfullscreen></iframe>


Putting it all together

So, I thought it might make sense to put some of these parameters together to show how they work in concert. In this example I hid the video information, hid the notes throughout the video and hid the video controls. Note that these parameters don’t work well with the modestbranding parameter so I couldn’t include it. The result is a very clean looking embed and optimal viewing experience for fans of Rick Astley:

<iframe width=”640″ height=”480″ src=”http://www.youtube.com/embed/yp9pTFcD2uk?showinfo=0&iv_load_policy=3&controls=0” frameborder=”0″ allowfullscreen></iframe>


If you have anything to add, please feel welcome leave a comment. And if this was of use to you, please take a moment to share this with others on your social networks. Happy embedding!

Jim Dougherty

Jim Dougherty

Writer and chief of miscellany at leaderswest.com
I'm the guy that wrote the article you just read. Sorry for the typos.

Comments

  1. says

    This is great information, Jim. I have to say though that I really, really don’t like it when I open a page and a video starts to play. I like very much being able to delete the related videos at the end of a YouTube video!

  2. jimdougherty says

    Thanks Carolyn! I understand how that can be off-putting, but the rationale for autoplay (in my mind) is to give a message or a snippet of a message before a person can arbitrarily opt out. I think that’s a powerful and useful tool to give content the highest likelihood of being noticed. Thanks so much for reading and commenting!

  3. Tony Restell says

    Great post Jim, thanks. I have another one for you to add to the list – having a video start part way through the recording if there’s some content you want to skip or a particular section of the video you want to show…

    I was writing a piece on using Facebook for recruiting and had a great webinar recording to use as part of the post (see: http://www.social-hire.com/social-recruiting-advice/1165/adding-facebook-to-your-social-recruiting-strategy-10-point-checklist) but the problem was that the first 2 minutes of the video came across unprofessional – checking the audio was working etc. and so I wanted to skip that. The code to achieve this is to add to your URL

    &start=108

    where the number equals the number of seconds into the video that you want it to start from.

    Hope this helps someone out there – and will certainly be looking to incorporate your other suggestions Jim. Not showing suggested videos at the end was something I’d already taken care of, but the other whitelabelling suggestions are great, thank you!

  4. jimdougherty says

    Hi Lisa! I think that you would do everything I did without autofollow. For example:

    $controls=0&showinfo=0

    and that should give you a video screen with just the play button! Thanks for reading and commenting!

  5. says

    Thank you Jim! WordPress only allows me to add the URL to the video. I haven’t been able to use the html like I was able to with Blogger. Should I be using a specific WP plugin instead so I can edit the html? Thanks for another great post!

  6. jimdougherty says

    Hi Lisa, as Samantha said this is for self-hosted (wordpress.org) websites. If you are using wordpress.com, here is a post that describes how to embed youtube videos:

    http://en.support.wordpress.com/videos/youtube/

    It’s been awhile since I used wordpress.com, but it appears from that article that you can accomplish the same things by adding the codes to the end of the video link. I’m curious and happy to help if you ever find yourself wanting to do this. Shoot me a message! Thanks for reading and commenting!

  7. says

    I am on the self hosted WP. For some reason each time I would add the html code the video wouldn’t show up. However, it does when using the URL. Therefore, I am unable to edit the code. I will check it out again the next time I need to use a video on a post. Thanks Jim and Samantha!

  8. jimdougherty says

    Thanks Lisa! Next time (if you like) I’d be happy to help troubleshoot for my own educational purposes.

  9. Ryan says

    Cheers Jim, I had been looking for this for a while, especially getting rid of the recommended videos at the end. For some reason I still cant get rid of the black bar at the top of the video. I have put the showinfo=0″ attribute into the code but it hasn’t worked. Any ideas? My site is http://www.commissiononlysalesjobs.co.uk if that helps?

  10. Hussain Badusha says

    Very useful notes that you’ve given.
    Thanks very much for providing this…

  11. Jonathan says

    hi, cAN YOU HELP ME WITH THE CODE TO HIDE THE YOUTUBE VIDEO URL FROM MY EMBEDDED VIDEOS ON MY WEBSITE?

  12. Shishir Bhilawadikar says

    What a superb post. Just loved reading it. Always wondered how to do these customizations. Thanks for posting this Jim.

  13. Katya Verman says

    Hello! Can you tell how to stop all the suggestions of the different videos which are not related to Company’s videos or how to make the video start from the beginning after ending?

  14. jimdougherty says

    Hi Katya,

    Sure.For the related posts the command you’re interested to change is “rel” – it can be either “0” or “1” and to turn it off, you want it to be “0.” &rel=0
    To repeat your video the command you are looking for is “loop.” It can be a value of “0” (no repeat) or “1” (repeat). &loop=1
    Hope that helps!

  15. Keef Hellinger says

    very useful thx, do you know how to remove the black border so that it is transparent and blends into my website. I have sized video to full page width via custom size but on a tablet the black border comes straight back? many thx in anticipation keef…. ps theme=light doesn’t work

  16. JD says

    Great info! FYI, your font size and page width is huge, I am on a 22″ monitor and still had to scroll left and right.

  17. jimdougherty says

    Appreciate the feedback – the site is supposed to be responsive, so I’ll have to do some more testing. Cheers!

  18. jimdougherty says

    I’m sorry – I looked into this and it doesn’t look like it’s easily possible in the new player. If YouTube gives you an option to use the old embed code you can use border=”0″ – otherwise I expect there is a solution but it’s beyond my technical aptitude. Sorry!

  19. bitkahuna says

    auto playing video is a huge no-no. if someone’s in an office cube and a site they go to starts blaring a video that they didn’t ask to play, it’s obnoxious and could even get someone fired. it ‘seems’ like a good or ‘powerful tool’ but it’s irresponsible and obnoxious. just sayin’
    on a more positive note, your summation of youtube options is really helpful, thank you!

  20. jimdougherty says

    Thanks for your comment. I don’t mean to sound like I disagree with your premise, but I will say that despite the general apprehensiveness towards autoplay video it has been studied and found quite effective. An analog might be ads in gmail – people by and large don’t want them but many click-through regardless.

    Not that it makes autoplay videos any less annoying to the user, but saying that they’re a “np-no” is not accurate from a marketing perspective. They’re actually quite effective.

  21. James says

    Thanks for the tips. Have you been able to successfully embed a youtube playlist, with the thumbnails/sidebar to show up on the right hand side of player? Just like when you visit your own youtube page. I can embed the player along with the playlist, but users must click on the top left of the video. Some older folks may struggle with this. Thanks!

  22. jimdougherty says

    Hi James – I don’t have any experience with playlists myself and I tried to take a look and see if I could offer an idea of how to handle your situation and it’s beyond me. Sorry!

  23. Stephanie Deneke says

    NICE! I’m making a capture page tonight and I just googled how to do the autoplay and your post showed up on page 1…. finding the other codes was a bonus so I bookmarked this on my browser :) I’m still trying to figure out how to hide the YouTube watermark in the lower right corner that says “watch on youtube” when you hover over it. If anyone knows how to do that it would be awesome to know.

  24. jimdougherty says

    Thanks Stephanie – your comment made me redo the entire most with more detail. I’m not sure that there is anyway to get rid of the watermark appropriately, but I hope the examples give you a visual of what each parameter can do. Very helpful comment – thank you!

  25. jimdougherty says

    Hi Harsha! In your embed code, believe that the second question mark (?) is throwing things off. I think if you replace it with “&” it should work.

  26. says

    Thank You! This worked.. However, I see that once the part of the video stops playing, YouTube buffer icon appears, and it seems, YouTube is trying to play in the full video now.. Your views on this?

  27. says

    Hello again.. can you also let me know how to apply the same settings to a YouTube playlist embed .. I am trying to use the same code, but am getting a message ‘Video not available’.

  28. jimdougherty says

    If I’m looking at the embed correctly, is there a semicolon instead of an ampersand between start and end? Maybe that would fix it? Other than that, I don’t know what the issue might be.

  29. jimdougherty says

    Hi Harsha – If you’re looking at the example that I put on there, the video was pulled from YouTube, and if the first video doesn’t work the others won’t either. If you’re talking about applying different parameters to different videos, I don’t have too much experience with that. You may want to experiment with it and see what works. Cheers!

  30. jimdougherty says

    Hi Marc,

    I looked again and I don’t know that you can control that with the embed options. I don’t know if the video is copyrighted, but if not I would copy the video and use a video editing program to marry the preferred audio to video and post to YouTube.

  31. Mitty says

    Hi, thx, that is what I was looking for, but one thing I need more. Disable option after right click to get URL of video. Anyone knows how do that?

  32. Ya says

    Awesome post – thanks. Thanks Jim …. it’s life Jim but not as we know it … not as we know it … not as we know it ….

  33. Joy says

    Hello, Jim. Do you know how to get a video to auto start with a delay of 30 seconds?

  34. jimdougherty says

    Hi Joy,

    If I understand your question correctly, I don’t know that you can delay the playback of an embedded video. There may be a way to load the script later, but it wouldn’t be something you can do within the embed script (I don’t think). Sorry.

  35. jimdougherty says

    Hi David, I don’t know how to do this. Sounds like something that you may have to do external to the embed script.

  36. Nancy Munford says

    I am not able to edit my embed settings anymore – does not take input. Is there a setting for this or do I need another kind of account? I was able to edit the input box when I did another website earlier this year. thanks

  37. says

    Excellent info! I tweeted it. The thing that kills me is whether you can stop the video from loading on each page. I run several wordpress blogs and I want the video to play only once to a viewer. So far it seems it can only be done in the master CSS file. Is there a way to do it in the video?

  38. jimdougherty says

    Hi Nancy,

    I just checked and don’t see a change. If you want to send a link I can offer a second set of eyes…..

    Jim

  39. jimdougherty says

    Hi Tene,

    Not that I’m aware of. I’m guessing that wouldn’t be something that would behoove Google to develop. I could be wrong on both accounts, though….

    Cheers!

  40. Colton Bridges says

    Hey Jim, Thanks so much for the info. It helped me an incredible bit. The only information I had to find elsewhere was how to fit it into as3 object embeds. but you made it so easy and so clear it was just a copy and paste. I will be sending my guys here as reference from my blog. Thank you so much.

    Colton Bridges

  41. Giridharan Dhanashaker says

    Hi Jim,

    How do I embed a youtube video with interactive transcript with it?

  42. jimdougherty says

    I’m not familiar with that one. A transcript you would simply put in your video, but interactivity is a whole other level. Cheers!

  43. Steve Allen says

    Jim, One of the most complete posts I’ve read on “how to” do anything. This is what I wanted to see. Had bits and pieces before, but now I have code to do anything I want! Thanks!

  44. Grace says

    This was great! Thank you so much for all the little tips I gleaned. I have one question, however; you have multiple videos on this page. Is there a code that can be added to the videos that makes one stop playing with I click on another video on the same page? Thank you again!

  45. jimdougherty says

    HI Grace, not that I know of. The benefit of embeds from YouTube is that all of the content is served by Google, so I suspect that it would be difficult to synchronize disparate embeds like that. If it is possible, it’s beyond my capabilities. For a simpler solution, maybe a playlist would be appropriate? Cheers!

Leave a Comment

Your email address will not be published.

Current ye@r *