Disable related videos on a embedded Youtube player
Youtube recently added a new feature to the video player used to embed Youtube videos on other website.
The new default player, once the video completes playing, will display a list of related videos.
While this feature could be useful for some users it is probably not wanted on Youtube video aggregation websites.
Fortunately it's possible to disable related videos.
Let's see how.
The default player
Let's take a cool video (I'm a windsurfing addicted).
The default embed code Youtube suggest us is
<object width="425" height="350"> <param name="movie" value="http://www.youtube.com/v/Yc_J_kXaFSw"></param> <param name="wmode" value="transparent"></param> <embed src="http://www.youtube.com/v/Yc_J_kXaFSw" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> </object>
Which will generate this:
As you can see, at the end of the video the player will display something like this:
Youtube related videos
Disabling related videos
The trick is to attach to the player URL (http://www.youtube.com/v/Yc_J_kXaFSw) the rel=0 parameter.
The player URL will became http://www.youtube.com/v/Yc_J_kXaFSw&rel=0
Just update the embed code with the new URL:
<object width="425" height="350"> <param name="movie" value="http://www.youtube.com/v/Yc_J_kXaFSw&rel=0"></param> <param name="wmode" value="transparent"></param> <embed src="http://www.youtube.com/v/Yc_J_kXaFSw&rel=0" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> </object>
The player now looks like:
We don't have more related videos!
Let's use valid XHTML code
Unfortunately the embed code provided by Youtube isn't valid XHTML code and does not pass the W3C's XHTML validation.
This is really bad as creating valid XHTML web pages is valuable and professional. In some countries it is even required by law for public administration websites.
So we can use something like
<!--[if !IE]> <--> <object type="application/x-shockwave-flash" width="425" height="350" data="http://www.youtube.com/v/Yc_J_kXaFSw&rel=0"> <!--> <![endif]--> <!--[if IE]> <object type="application/x-shockwave-flash" width="425" height="350" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"> <![endif]--> <param name="movie" value="http://www.youtube.com/v/Yc_J_kXaFSw&rel=0" /> <p>Your browser is not able to display this multimedia content.</p> </object>
The above code, which come from my Drupal video module, is valid XHTML code and works with the most used web browsers.
The above code generate:
Conclusions
You are now able to control the behavior of Youtube player related video and post on your website Youtube videos following XHTML standards.
References
- fabio's blog
- 36895 reads





Remove embedded youtube video
Can someone tell me how to remove my embedded youtube video from my wordpress front page.
Thanks for the tip
Thank you for the excellent tip.
Disable Youtube click through
is it possible to disable a CLICK through to the YOUTUBE site when an embedded video is playing.
i.e. prevent a user such as a child going direct to Youtube?
I just want to say....
THANK YOU MAN!
Cheers :)
Graviranje i secenje
Excellent, but anyway I wanted to find somewhere a way to not appear different clips.
&rel=0
Sweet tip!!!
tks
Thanks for help - great advice!
You saved me a lot of time. I started to thing about posting video on some other site instead Youtube - but thanks to you - it is all fixed now.
Works great!
You tube and W3C validation
I think you joke.. tell me where why your code is not validating:
<-->
...
Please try this link to see tell me where I wrong:
http://www.validome.org/xml/validate/
Anyone has the Answer but which is that??
Thank you
clever trick
Actually, I am doing some gray hat technique for youtube videos. I know they can be banned any time. But a lots of thanks to you coz now I am sure that I won't get banned to disable those videos.
Till now I was using youtube videos in my own player.
grad
Thank you very much, this is really to use due to competition....
I'm still having problems
Here is my embedded info where do I place the rel=0?
Thank you so much for your help
Hi, Thanks a ton. It really
Hi,
Thanks a ton. It really helped save lot of time.....
Thankyou worked a treat!
Thankyou worked a treat!
Thanks
Thanks for the information man. Saved lot of time.
Ok, successful for my facebook page...
Posted a clip of my kids and an sexy video is related... I was able to remove the related video on my facebook but if people go directly on youtube, they will see the related video still.... I changed the category, changed the description so any word could be seen related... But its still there, on youtube itself. Anyone knows how to have that changed?
Unfortunately the procedure I
Unfortunately the procedure I describe here is only for embedding videos on websites. I'm not aware of any procedure for disabling related videos on Youtube itself.
I don't know if it is possible. Anyway you can ask for help in the official Yotube forum. There you'll probably find more informations.
http://www.google.com/support/forum/p/youtube?hl=en
You Are the Man!
You saved me from doing a lot of work finding a stand alone player and video hosting for a client. Once again, YOU ARE THE MAN!
Wonderful
Thank you very much !
Thank you!!
rel=0 worked great!
Postei um védio no youtube e
Postei um védio no youtube e existe um vídeo indesejado relacionado ao meu. Já tentei mas não consigo extraí-lo de lá.
Ajuda ?
I'm sorry. Would you please
I'm sorry. Would you please ask the question in English? Not able to understand Portuguese.
Good tip
It's sad that we have to do this now but thank you for sharing this information. It will come in handy!
Excellent!
Thanks for being the top "Google" search result for "remove related youtube"! Clear and easy explanation.
Thnak you. it worked , very
Thnak you.
it worked , very nice.
Thanks! I really needed
Thanks! I really needed this! There was an inappropriate movie right after the on I wanted that would show up as related videos.
Wordpress
Does this work with wordpress? I have tried it but it still shows up.
thank u man i'll check it
thank u man
i'll check it
Thanks for the TIP
Worked great!!!!
While this feature could be
While this feature could be useful for some users it is probably not wanted on Youtube video aggregation websites.
mpcoc
How do I remove the URL at the bottom of the embedded player?
The HTML code provided by YouTube for a custom embedded player is generating a border at the bottom of the player that contains the link to our YouTube Profile page, e.g., youtube.com/user/name.
How can this link be removed or kept from appearing?
Have you tried using the
Have you tried using the code provided in the article? It does not display any username link.
You just have to copy and past the last code and substitute any occurrence of Yc_J_kXaFS with the id of your video.
eg. if your video has url (the browser address) http://www.youtube.com/watch?v=CQzUsTFqtW0 you will substitute Yc_J_kXaFS with CQzUsTFqtW0 in the last code I provided.
Hope this helps, if you still needs help just post here.
correction
In the above question, the link was not meant to be an actual one, but it apparently links to an actual page. Please ignore the example.
I modified your comment to
I modified your comment to let the link disappear.
Don't Advertise For Your Competition on You Tube
If you use You Tube to host business related videos that you then place onto your website or blog you are running a nice traffic feed for your competitors as videos with related content are offered at the end of your video. I have always suggested that my associates do not do this.
I appreciate this revelation and the specific code to solve this problem. I will put it into practice and add it to my coaching program for the people I work with in online marketing.
Great tip!
James
http://www.Twitter.com/AskJamesHolmes
I needed this!
Thank you so much. I've wondered for a long time whether I could do this, and I finally Googled it. So glad your (very clear) explanation was near the top.
rel=0 was useful.....
Thank you... this information was extremely helpful to me....
I was trying to find how to disable the youtube related video.... and your blog was the solution i needed.
when you double click
when you double click quickly within the video player, it brings you to the original youtube page.. is there any way to disable that? would be great
thanks
Thanks a Lot.This is really very useful.
keyeagle
Thanks a Lot
Thanks a Lot.This is really very useful.
Thanks a lot
Thanks a lot,
related videos really irritated me. After using that code on article Sokobanja zimi I don't have related videos anymore.
Great advice !!!
Thanks so much for it! I
Thanks so much for it! I actually was able to find your site really fast :) Thank God for SEO ^^
Adjust YouTube Customised Players Alpha
Can a parameter of the youtube customised player code be set to say 50% alpha so that the outer edges of the customised player will be see through but the videos that play stay normal? Please indicate how with the below code is so...
mmm
Sorry.. but I'm not aware of any option for this. Anyway you should ask to more expert people..
You might want to try the Youtube Forums:
http://help.youtube.com/group/youtube-help
Hope this helps.
display only selected video.
I dont want to disable all related video but want to show selected video which are uploaded by particular user.
How can i do this?
I'm not aware of any option
I'm not aware of any option to enable this.
Anyway with the new Youtube APIs this feature might be available. You should ask for help on the Youtube Apis developers group.
Great Thanks !
Great Tip !
I want to disable youtube from displaying the list of related videos and your tip really solve my problem.
Thanks !
Here is my site:
Magictube - Free Magic Tricks Video
thanks
i know this article is old but it still great information.
THANKS this is what i looked for
Dear Fabio
indeed this is what i was searching for.
while searching i found the parameters
for automatic starting
&autoplay=1
and looping
&loop=1
the youTube video
does anybody know even more or has a parameter-list?
--
hope they keep it working like this for a while!!
ciao
henrik, berlin, germany
Thanks Henrik for your
Thanks Henrik for your comments and for sharing your finds. Good to know that we can also autoplay and loop youtube videos.
I think that the youtube embeddable player actually have a lot more of paramenter but unfortunately Youtube doesn't provide documentation for them.
Yes.. A Youtube parameter-list might be really useful.
disable links
one other person asked how do you disable links and your answer was that the question wasn't clear so let me ask the same thing but in a different way.
when you embed a Youtube video, by either the way you described or the way youtube suggests, the embedded video has a start button in the center of the video view window. click on it and the video plays. if you mouse over any other part of the video window, you have the little finger. if you click, you are taken to the youtube video channel that that video is from...
how do you disable this link so that only the video plays, but is not a link back to youtube?
thank you in advance,
_Matt
Post new comment