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.



Thank you!
I sure do appreciate all you smart people taking the time to set up these types of forums!
If you want to do this
If you want to do this automatically, you can use the Youtube embed tool here:
http://www.davewooding.com/how-to-customize-and-embed-a-youtube-video/
Thanks.
Dave
Yeah... but not 4 years ago
Yeah... but not 4 years ago ;-)
great
thanks a lot!!
Works!
Worked like a charm, thanks for the code(s). Now I got to change all my vids.
admin edit: removed spam looking link. Only links to personal/non profit websites are tolerated.
Or use Youtube's own function...
Alternatively you can use Youtube's options under the embed code and untick the one that says 'Include related videos'. :)
Not four years ago.
Not four years ago.
Thanks for info Is there a
Thanks for info
Is there a way once I've embeded a youtube in my wordpress blog..that when poeple click on the youtube video it keeps people on my blog when watching youtube video rather than taking them to the youtuve site to watch the video when they click the video twice?
Really appreciate your speedy reply on this
Talk soon
Chris :)
According to
According to http://www.warriorforum.com/main-internet-marketing-discussion-forum/210... you can use:
Let me know if that worked.
It works!
Yes it WORKS!!! thanks man!
Admin edit: sorry, spam link removed. Only link to personal or nonprofit websites are tolerated.
nice tutorial of video posting
hi, i also looking for the way to stop related video at the end of my site.
thanks so much for providing this awesome script.
happy coming new year
ADMIN EDIT: Sorry, link removed. Only links to personal or non commercial websites are tolerated.
Thank you very much, I
Thank you very much, I stumbled upon this completely by accident - I wasn't even looking for articles on how to remove related videos from YouTube player - but this is excellent information and i'll be definitely implementing this on my own websites. Thanks again.
Thanks very much !
Trying to get rid of those darn after videos with no luck, but your embeed code helped right away.
Thanks very much for your help by posting this :o)
Admin edit: Removed link. I'm sorry only links to personal websites are tolerated.
I've been wondering for a
I've been wondering for a while how to disable that "feature" - I always thought it was against the Youtube TOS or if not simply impossible to stop the related videos at the end. I'm glad I can stop it for my website as it looks far more professional to just end the video immediately and not pop up with some more videos which may or may not be relevant to the video I want to display on my page.
Best Wishes, Julie Bergestein.
ADMIN EDIT: removed links to business website. Only links to personal websites or to related pages are tolerated.
Thanks!
Thanks! The content on this page was very helpful.
THANK YOU VERY MUCH. I WAS
THANK YOU VERY MUCH. I WAS SEARCHING FOR THIS SINCE LONG BACK. It helps me a lot
Thanks very much.
Thanks very much.
thanks so much
thanks thanks thanks.... this site is very helpful.... keep it up gurus!
Show video without paying $70, nice!
Last web site I set up video on we purchased a codac for $70 and it was complicated to set up... This took 5 minutes (faster if it had been a site I was working on) and worked... can't say thank you enough!
Thank You
Just wanted to add thx for this - it is people like you that share information and make developers lives much easier. on a related note, all joomla users note that this works in joomla also.
"I am what I am because of
"I am what I am because of who we all are."
And I would add: If I improve and then share, we all improve.
thanks so much for this also
thanks so much for this also i wanted to know about how i disable clicking on youtube, dailymotion and other service plyaer
Admin edit: removed spam looking link.
thnks....
thanku for this article....
Thank you very much for your
Thank you very much for your post.
great
this is great, thanks
disabling related videos
Excellent. Many thanks for that, extremely irritating YouTube feature disabled on my blog.
Banja Vrujci Video
Thank you for this very useful tip, i dont like these "related videos" at all. Also i have some clips from youtube on my site http://www.banjavrujci.info/smestaj/video and i am going to put your code to disable related videos. Thank you once again
Great blog - Awesome!
Hey thanks for making that quick and easy tutorial blog. I really rely on things like this for my learning curve. I did just made the changes to my video at http://www.brentlane.com it's right no the front page. We used green screen actually ($.50 poster board scotch taped together) and then did some pretty neat stuff in the video. Check it out if your interested.
Once Again thanks for the blog post. It was clean, concise, and most importantly was the first one I found. I am going to link to this blog post from mine on the site. Cheers.
Tool that does this for you
Here is a tool that does this for you:
http://norelatedvideos.weebly.com/
apartmani
Great tips. Thanx. Very useful
Thank you for the tips!
Thank you for the tips!
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'm looking for the
I'm looking for the same!
Anybidy knows how t do this?
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 !
Post new comment