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
Comment #1
guschilds commentedI was only able to reproduce this when using the YouTube Colorbox module. Are you using that?
Without the YouTube Colorbox module in place:
Expected and actual result: No related videos are shown and when looking at the source, the
rel=0parameter is added to the iframe src.With the YouTube Colorbox module in place:
Expected result: No related videos are shown and when looking at the source, the
rel=0parameter is added to the iframe src.Actual result: Related videos are shown.
rel=0has 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!
Comment #2
mholloway commentedI am having the same problem with the Youtube Colorbox module enabled. No rel=0 on the Youtube links.
Comment #3
guschilds commentedThanks 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. :)
Comment #4
guschilds commentedUpdating title. This should include both the global module-level parameter settings as well as the per-field display settings.
Comment #5
mholloway commentedAs an emergency temporary fix I used a views field template file to add rel=0 to $output
but that's very hacky!
Comment #6
guschilds commentedComment #7
hunchang commentedI 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
Comment #9
guschilds commentedThis 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=0will 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.