I've been testing your module and it looks great and I see that it is working on your Drupal Hub site so I don't know what I am doing wrong. I've tried adding a YouTube link to your Drupal Hub site by entering both the embedded text and just using the hyperlink and neither of them will display the video on your site.

I've tried entering the link this way:

http://www.youtube.com/v/glse_zAiYAE&rel=1

and the video just doesn't display at all although I can see there are other YouTube videos on your site. Can you tell me what the correct way to set up these links is?

Thanks,
Shelley :)

CommentFileSizeAuthor
#5 youtube_rel.patch431 bytessebs

Comments

theorichel’s picture

I am having precisely the same problem

Theo Richel

theorichel’s picture

But I got it working by pasting an embedded code from YT that doesnt include related videos

aaron’s picture

Component: Documentation » Code
Assigned: Unassigned » aaron
Category: support » bug

ah, looks like i need to tweak the regex parser to account for &queries.

thanks,
aaron

sfinerty’s picture

Sorry - thought I updated this - I also got it working with out the '&rel=1' on the end of the URL which I am guessing signifies including 'related videos'.

sebs’s picture

Title: YouTube not working for me » YouTube not working (patch)
Status: Active » Needs review
StatusFileSize
new431 bytes

Attached is a patch file with a regex modification; it allows youtube video IDs to be extracted when they contain &rel=1.

Please review this code, as my regex skills are not optimized. Also, this is the first time I'm submitting a patch file, so please let me know if I need to change anything regarding the way I'm submitting it.

cheers,
Sebastián

bao truong’s picture

Hi Sebastián,

I had the exact same problem and posted it on the bugs section but did not hear a response and so I am really glad to stumble across this post in pending bugs section. I have never applied a patch before so please excuse my Drupal incompetence, but would you be able to tell me how to exactly apply this patch? I've already installed the latest embedded media field module.

aaron’s picture

Status: Needs review » Fixed

changed it to

    '@youtube\.com/v/([^"\&]+)@i',
    '@youtube\.com/watch\?v=([^"\&]+)@i',

to handle things more generically. there was a " at the end that shouldn't have been there.

thanks sebs & everyone.

aaron

bao truong’s picture

So are we replacing:

return array(
-    '@youtube\.com/v/([^"\&]*)"@i',
+    '@youtube\.com/v/([^"\&]*)(&rel=.)?"@i',
     '@youtube\.com/watch\?v=([^"\&]*)@i',
   );
 }

with

return array(
    '@youtube\.com/v/([^"\&]+)@i',
    '@youtube\.com/watch\?v=([^"\&]+)@i',
   );
 }

?

aaron’s picture

if you download the latest version, it will have the patch applied. (i didn't post the revision of the patch here; i just applied it directly).

Anonymous’s picture

Status: Fixed » Closed (fixed)

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