Recently I need to embed a video on a clients landing page I was making for them and they really wanted to use YouTube to host the video. Thing is... I didn't want the video title and control bar to appear on the video. So after a ton of research and 2 hours of hacking code I came up with this solution. I still haven't found away to make the video keep auto playing more than once, so if you know how or figure it out... please leave me a comment below.
Use the code and edit the Bold sections:
Where it says YOUTUBE URL HERE insert your youtube embed url, NOT the url of the YouTube page.
Now If you want the video to autoplay then at this code &autoplay=1 to the end of your YouTube URL.
It should look like this:
<div style="width:380px; height:230px; overflow:hidden!important; text-align:center;"><br />
<object type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" height="410" width="380" style="position:relative; top:-90px;" data="YOUTUBE URL HERE">
<param name="allowScriptAccess" value="never" />
<param name="allowNetworking" value="internal" />
<param name="movie" value="YOUTUBE URL HERE" />
<param name="wmode" value="transparent" />
</object>
http://www.youtube.com/v/p9tL59oBbIY&hl=en_US&fs=1&rel=0&autoplay=1
{ 10 comments… read them below or add one }
Wow. I was actually wondering about this like a week or 2 ago. The only problem is the fact that you only have 11 mins to work with…
Video Sales letters probably won’t work too well with this, but then again, maybe anything else.
I was just going to use Camtasia with no controls!
Hey, I tried that code and it wasn’t working, I just copied and pasted it and put my video’s url (http://www.youtube.com/v/yTWRsBj2OX0&hl=en_US&fs=1&rel=0)
I can’t even see the video, nothing appears at all
Just checked… it still works for me. My be you are messing something up in the copy and paste?
Hey, thanks for posting, if you want to loop the movie just put &loop=1 after the &autoplay=1 without any spaces and it will work.
Regs,
ThL
Cool! I will have to try it out. Thanks
what do you mean by “insert your youtube embed url, NOT the url of the YouTube page”. Where exactly do you get the youtube embed url, can you show me an example ?
Thanks
The reason this code isn’t working is because the quote symbol after the width and height parameters above are not copying correctly. You need to replace them after you copy and paste the code segment.
Hi Kevin,
Great post! Works beautifully! Could you tell me how I would increase the size of the video. Can’t seem to find the parameter for that.
Thanks in advance.
Bye! Marnix
Hey Guys.
Actually there is a lot of parameters (including hiding the navigation) in the native youtube support: http://code.google.com/intl/da/apis/youtube/player_parameters.html
So no need for DIV’s
So, what’s making the controls not appear is the fact that your using “overflow hidden” and making the height -90 px less than the actual media player??? Is that right…