Currently when the video url is like "//youtube.com/embed/AAAAA" then parameters are not added to the embed b/c the embed_url being passed into _mytube_fixembedded() has been changed to http:// due to the parsing in the calling function _mytube_replaceembed() to remedy this I propose we change the following:

...
  $embed_url = preg_replace("[^//]", $PROTOCOL, $embed_url);
  $embed_urlinfo = parse_url($embed_url );
...

to

...
  $parseable_embed_url = preg_replace("[^//]", $PROTOCOL, $embed_url);
  $embed_urlinfo = parse_url($parseable_embed_url);
...

Also, the code for youtube-nocookie.com is duplicated from youtbe.com in _mytube_fixembedded(). Instead of duplicating this code I propose we remove the duplicated code and add youtube-nocookie.com as a fall through to youtube.com.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

grndlvl’s picture

I have attached 2 patches to address the issue.

mytube-fix_adding_parameters-2423479-1.patch applies to 7.x-1.x-dev without any other patches.
mytube-fix_adding_parameters-with_firstChar_patch_2421701_1-2423479-1.patch applies with the patch from #2421701: Notice: Use of undefined constant firstChar applied.

grndlvl’s picture

Whoops didn't catch that the thumbnail function is plagued by the same issue. Passed in the parseable version of the url for the thumbnail generation.

I have attached 2 patches to address the issue.

mytube-fix_adding_parameters-2423479-2.patch applies to 7.x-1.x-dev without any other patches.
mytube-fix_adding_parameters-with_firstChar_patch_2421701_1-2423479-2.patch applies with the patch from #2421701: Notice: Use of undefined constant firstChar applied.

grndlvl’s picture

Actually I needed a patch with the firstChar patch @ #2421701: Notice: Use of undefined constant firstChar & the theme patch @ #2082717: Embed code replacement HTML should be generated in a theme() function. So here is that too, but I will hide it so it won't cloud the patches.

grndlvl’s picture

grndlvl’s picture

Welp still missed some other instances and logic was adding two ?? I have now adjusted the logic for even further.

  • mfb committed 57e08ec on 7.x-1.x authored by grndlvl
    Issue #2423479 by grndlvl: Added paramaters are not always being added...
mfb’s picture

Status: Needs review » Fixed
grndlvl’s picture

Status: Fixed » Closed (fixed)

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