Problem/Motivation

Video parameter settings are not respected when a video is opened in a Colorbox with the YouTube Field Colorbox module.

Proposed resolution

Configure the video that opens in the Colorbox to respect the global module video parameter settings at the very least. It would be even better if, when selecting the thumbnail to link to a Colorbox, the field-specific list of parameter options was presented and could be configured as well.

Remaining tasks

Get a patch written, reviewed, tested, and committed.

Original report by ngreenup

Whether I have "Show suggested videos when the video finishes (rel)." Checked or not, all my videos show related videos at the end. When I look at the markup there is no "rel=0" added to the URL. Have tried clearing my caches but it seems to have no effect.

Comments

guschilds’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

I was only able to reproduce this when using the YouTube Colorbox module. Are you using that?

Without the YouTube Colorbox module in place:

  1. Install a clean version of Drupal with the YouTube Field module enabled.
  2. Add a YouTube field to a content type.
  3. Add a piece of content with a value for the YouTube field.
  4. Uncheck the "Show suggested videos when the video finishes (rel)." option in the YouTube settings configuration form.
  5. Go to the piece of content and scrub the video to the end.

Expected and actual result: No related videos are shown and when looking at the source, the rel=0 parameter is added to the iframe src.

With the YouTube Colorbox module in place:

  1. Follow the steps listed above.
  2. Enable YouTube Colorbox and ensure the plugin is in place and the Colorbox load option is enabled.
  3. Change the display settings of the video field to output a thumbnail that is linked to a Colorbox.
  4. Go to the piece of content and click the thumbnail to open the video in the Colorbox window.
  5. Scrub the video to the end.

Expected result: No related videos are shown and when looking at the source, the rel=0 parameter is added to the iframe src.
Actual result: Related videos are shown. rel=0 has not been added to the iframe src.

Please let me know if you were in fact using the YouTube Colorbox module. This issue can then be changed to address that problem. If not, please provide steps for me to reproduce the issue with a clean install of Drupal and the YouTube Field module. Thanks!

mholloway’s picture

I am having the same problem with the Youtube Colorbox module enabled. No rel=0 on the Youtube links.

guschilds’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks mholloway. Going to work to get the YouTube Colorbox videos to use the same options as videos without the Colorbox. If anyone beats me to a patch, I'd be happy to review it. :)

guschilds’s picture

Title: Show suggested videos option doesn't work » YouTube Colorbox videos should use same param options as non-Colorbox videos

Updating title. This should include both the global module-level parameter settings as well as the per-field display settings.

mholloway’s picture

As an emergency temporary fix I used a views field template file to add rel=0 to $output

 print str_replace('iframe=1', 'iframe=1&rel=0', $output);

but that's very hacky!

guschilds’s picture

Issue summary: View changes
hunchang’s picture

I do not have experience on creating module, but after reading some of the code and add in 1 extra line of code in "youtube.module".
Line 435 with $display['settings']['colorbox']['parameters']['rel'] = 0;

I'm not sure if this is a correct way of doing so, but may give you some clue to fix

  • guschilds committed 024f96c on 7.x-1.x
    Issue #2365565 by guschilds: Changed YouTube Colorbox implementation to...
guschilds’s picture

Status: Active » Fixed

This fix has been committed to the 7.x-1.x branch and will be available in the next release.

Colorbox videos will now respect the global module settings when constructing the URL. This means parameters like rel=0 will work when set in the module settings. Colorbox videos will now also have the same parameter options in the display settings that non-Colorbox videos do, like showinfo, controls, autohide, etc. These options will also be used when constructing the video URL.

This should not have any unintended side effects on current implementations unless the global module settings conflict with their intentions.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.