Youtube Code Secrets

Yes, I know I havent written a blog post in a while. I’ve been pretty busy behind the scenes working on some things.  So fair warning: Blog posts are gonna be sporadic for a little while. Bear with me.

So, as a peace offering, I’m giving away some of my secret stash of embedded YouTube video URL hacks. These are the codes that I use when I’m styling out someone’s website that has Youtube content on it.

Start A video automatically on page load

Want your visitors to see your video right away? You can easily get your video to start automatically when the page loads up by simply adding this code to your  embed code:

&autoplay=1


Turn Off Video Title Display

If you want to turn that annoying title box off on embedded videos,  simply use  this code:

&showinfo=0


Turn Search Off

If you want to turn off the search feature on embedded videos, just use this quick little code.

&showsearch=0


Turning Looping On or Off

How about getting that video to play again and again? For whatever reason you may have for looping a video (Say, for some music), you can easily accomplish this with this little bit of code:

&loop=1 or   (Turns Looping On)

&loop=0  (Turns Looping Off)


Menu Color

Everyone knows YouTube comes with a blah colored menu bar by default. But, with a little tinkering you can make that menu bar match the colors of your site. Don’t know how to do HTML colors? Well W3C Schools.com has a quick little explanation of what they are and some examples that you can take a look at. Also on the next page of their site, they also have a bunch more.  So, go find your colors, and enter it into your embed code! Also, this is pretty important: Color 1 is the primary border color and Color 2 is the video control background color.

&color1=FFFFF  (Make sure you replace the FFFFFF with your own HTML color code)

&color2=FFFFFF

Important note: There is no # (hash) before the Hex value of the colors as you would use in regular HTML or CSS coding for this.


Border Color

Want a pretty border surrounding your video? Thats easy enough! Just use this little code here:

&border=1

By the way, how do you set the color of the border? Well, they’re set by the color1 and color2 settings like the one above. The idea is that the border will match your menu colors.


Remove Related Videos

This code is my #1 most used bit of code that I hack YouTube URLS with more than any other. And the reason is pretty simple. When you watch a YouTube video to the end, you usually see a bunch of related videos that YouTube seems to think you want to see.  Some may be from the same person who’s video you just watched, while others may be somewhat related by topic of the title of the video.  If you’re embedding your own videos from YouTube onto your site, theres a good chance you really dont want those related videos showing. So turn em off like this!

&rel=0

Get To The Good Part

Lets say you have a video of you and a few other people at a speaking conference. And you don’t want to subject your viewers to the 45 minutes of boring people before you on stage? Well, just skip them!  Get to the good stuff! Add this bit of code to your URL and get there right away.

&#t=45m37s (Make sure you replace the time before the m and s with your own times!)


Enable HD video playback

If you upload a video in HD, you can actually force YouTube to play your videos in all its HD glory! Add this code to your URL and let people get a nice HD quality video.

&=hd=1


Disable keyboard controls

Did you know that YouTube allows you to control videos with your keyboard? I personally rarely use the controls, but if theres any reason you want to turn off the keyboard controls completely, you can easily do that with this little bit of code at the end of the address.

&disablekb=1

And  if youre wondering, here are the keyboard controls:
  • 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 Dow

Putting it all together

Here is the embed code for the video below.  Notice that I don’t have the autoplay function on, because I figured with the video on the bottom of the page, it would be pretty creepy hearing the music and what not and not have a clue what was going on.

Before I go any further, you may notice that I use “&” as opposed to “&” above. They are interchangeable in your YouTube URL.  Ive included both in the example to show that.

So a quick breakdown:

http://www.youtube.com/v/nj3hLSP1vFo?fs=1&hl=en_US&rel=0&color1=F761380&color2=FFFFFF&showsearch=0&rel=0&showinfo=0&border=1

http://www.youtube.com/v/nj3hLSP1vFo This is the actual YouTube URL (its always http://www.youtube.com/v/VIDEO_ID)

&rel=0
&color1=F76138
&color2=FFFFFF
&showsearch=0
&rel=0
&showinfo=0
&border=1

<object width=”480″ height=”385″><param name=”movie” value=”http://www.youtube.com/v/nj3hLSP1vFo?fs=1&amp;hl=en_US&amp;rel=0&amp;color1=F76138&amp;color2=FFFFFF&showsearch=0&rel=0&showinfo=0&border=1“></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”http://www.youtube.com/v/nj3hLSP1vFo?fs=1&amp;hl=en_US&amp;rel=0&amp;color1=F76138&amp;color2=FFFFFF&showsearch=0&rel=0&showinfo=0&border=1” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”480″ height=”385″></embed></object>

And there you have it! Questions, comments, hate mail. Leave em in the box below!

  • http://clayfranklin.com Clay Franklin

    Thank you for sharing these codes to help embed You Tube videos into my site.
    Turning off the related videos is a “must have” that I did not have until now.
    Nice to meet you on Twitter tonight during #blogchat

  • http://twitter.com/lazarus2000 Lazarus

    Youre definitely welcome Clay! Glad you found it useful!

    It was really nice meeting you on #BlogChat as well!

  • http://martynchamberlin.com/ Martyn Chamberlin

    There are definitely some useful tips here. However, deactivating related videos, adding borders and having different color schemes is already easily manipulatable in the YouTube interface. Have you taken this into consideration?

    Oh and yes, the 404 page is awesome. ;)

    • http://twitter.com/lazarus2000 Lazarus

      Yes you can do different color schemes in the YT interface but you are severely limited to what they give you. If you look at the interface, you’re only given 9 color choices. Doing it manually allows you infinite color combinations that match the look of your site’s color scheme.

      • http://martynchamberlin.com/ Martyn Chamberlin

        Yeah, good point. Something else I was wondering though…does YouTube normally not treat HD videos as HD or what? Or is that only when you embed them?

  • Anasluv

    thx for this advise but i want to know can i use these steps on vimeo ???