WordPress.org

Ready to get started?Download WordPress

Forums

Disabling YouTube's "feature" (7 posts)

  1. Adam Brown
    Member
    Posted 7 years ago #

    YouTube has introduced an idiotic new "feature" that results in adult-themed videos being hawked at the end of your embedded videos. (read more in the MU forums)

    If you're using the Viper Video Quicktags plugin, this is what you need to do to disable YouTube's new feature. It took me a little effort to figure this out, so I'll post it here for others.

    Open vipers-video-quicktags.php (NOT .js).

    Around line 662, make this hack. You can tell from my commenting what you need to do. The original lines are commented out, with my inserts following where appropriate.

    if ( 'youtube' == $params['type'] ) {
    						$url = $linktext = 'http://www.youtube.com/watch?v=' . $data['videoid'] . '&rel=0'; // adam's hack: deleted
    						#$url = $linktext = 'http://www.youtube.com/watch?v=' . $data['videoid'] . '&rel=0'; // adam's hack: add &rel=0
    						#$this->jsoutput .= '	vvq_youtube("' . $objectid . '", "' . $data['width'] . '", "' . $data['height'] . '", "' . $data['videoid'] . '");' . "\n"; // adam's hack: deleted
    						$this->jsoutput .= '	vvq_youtube("' . $objectid . '", "' . $data['width'] . '", "' . $data['height'] . '", "' . $data['videoid'] . '&rel=0");' . "\n"; // adam's hack: add &rel=0
    					} elseif ( 'googlevideo' == $params['type'] ) {

    Good luck.

  2. Adam Brown
    Member
    Posted 7 years ago #

    Also pasted at http://wordpress.pastebin.ca/584414 for easier reading.

    And no, I'm not really using wp1.2.2. That should say wp-mu 1.2.2.

  3. Dinzer
    Member
    Posted 6 years ago #

    How about the legality of this? Here's what Youtube's terms say about it:

    F. If you use the YouTube Embeddable Player on your website, you must include a prominent link back to the YouTube website on the pages containing the Embeddable Player and you may not modify, build upon, or block any portion of the Embeddable Player in any way.
    http://www.youtube.com/t/terms

    I'm thinking of using this plugin but I'm concerned about legal issues. I know the plugin doesn't include the hacks though. It would be interesting to hear other people's opinion about this issue.

  4. Adam Brown
    Member
    Posted 6 years ago #

    This doesn't do anything to modify the video. It just adds a parameter to the YouTube URL--a parameter that YouTube itself acts on. YouTube told people with embedded videos to go through and add "rel=0" to the end of their URLs if they didn't want links to other videos to show up at the end.

  5. EvilE
    Member
    Posted 6 years ago #

    Thanks for posting this!

  6. leslyejoy
    Member
    Posted 6 years ago #

    I'm having the same problem. I tried the fix but maybe I'm not inserting the rel=0 in the right place -- although I tried it in multiple places and also with and without quote marks around it.

    Here's my embed code. Please advise exactly where and what characters I should insert. Many thanks!

    <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/AAa8MLxNLcc"></param><embed src="http://www.youtube.com/v/AAa8MLxNLcc" type="application/x-shockwave-flash" width="425" height="350"></embed></object>

  7. leslyejoy
    Member
    Posted 6 years ago #

    In case anyone's out there...I just found the correct fix. What you need to insert is &rel=0 right after the url in both places it appears in the code. So in the example above, like this:

    <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/AAa8MLxNLcc&rel=0"></param><embed src="http://www.youtube.com/v/AAa8MLxNLcc&rel=0" type="application/x-shockwave-flash" width="425" height="350"></embed></object>

    This issue had me tearing my hair out, so I hope this fix is helpful to others.

Topic Closed

This topic has been closed to new replies.

About this Topic