Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is the D7 version capable of displaying YouTube videos yet?
I have tried using a media field with a YouTube wrapper, a text field with a simple YouTube-link and setting up the vfl player (jwplayer) in the lightbox2 settings page.
Following the documentation as it is, it should be a matter of simply adding rel="lightvideo"
to a YouTube link. But that can't be right.
Has anyone successfully used lightbox2 to display a YouTube video?
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedChanging
rel="lightvideo"
torel="lightframe"
actually shows the lightframe. The content is however completely empty.This is the HTML source:
<iframe width="600" scrolling="auto" height="400" src="http://www.youtube.com/watch?v=GHWDKc49eJU" style="z-index: 10500;" id="lightboxFrame"></iframe>
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedI couldn't get this to work and decided to use shadowbox.module instead, which was very easy to setup.
I'll leave this open because I'm still curious but it's not urgent anymore.
Comment #3
kyawzayl CreditAttribution: kyawzayl commentedHi Guys,
I was also having this problem but found the workaround for this. Basically we can't use the new embed code form YouTube but to use the old embed code. The below is the working sample.
Watch Video
We gotta use the old embed code from YouTube and grab that url in href then it works just fine.
Hope it helps someone out there.
Comment #4
poman31 CreditAttribution: poman31 commentedI have this working for Youtube embed videos.
First use a normal href tag (link). Point the link to the youtube video. Second make sure to edit the HTML and add rel=lightframe to the tag after the href tag.
So the raw html should look like
also you can add ?autoplay=1 to the end of the url to auto play. ie "http://www.youtube.com/embed/C4q9vkSD8VE?autoplay=1
You don't even have to enable or setup a FLV player.
Make sure to not include all the iframe code just the link.