Is there a way of disabling YouTube's "Suggested Videos"? I've looked, and from their "Embed" menu, it shows adding "rel=0" to the end of the URL to accomplish this. However, even doing so, I still get the window full of other videos that YouTube thinks I might like. While using the module, I also get these suggested videos in a line across the bottom of the window, if I happen to pause the video.

How do I prevent these other videos from coming up?

I am using Version: 8.x-1.2

Any help is appreciated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BEGRAFX created an issue. See original summary.

lvbeck’s picture

I have the same problem with you, here is my workaround solution:

in
..\modules\contrib\video\src\Plugin\video\Provider\YouTube.php:

you can add the rel parameter in function renderEmbedCode

  public function renderEmbedCode($settings) {
    $file = $this->getVideoFile();
    $data = $this->getVideoMetadata();
    if(!isset($settings['rel'])) {
      $settings['rel'] = '0';
    }
    return [
      '#type' => 'html_tag',
      '#tag' => 'iframe',
      '#attributes' => [
        'width' => $settings['width'],
        'height' => $settings['height'],
        'frameborder' => '0',
        'allowfullscreen' => 'allowfullscreen',
        'src' => sprintf('https://www.youtube.com/embed/%s?autoplay=%d&start=%d&rel=%d', $data['id'], $settings['autoplay'], NULL, $settings['rel']),
      ],
    ];
  }
BEGRAFX’s picture

Awesome! I'll give that a try. Thank you!

jeetendrakumar’s picture

Status: Active » Needs review