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.
It would be nice to have some support for colorbox. So a site builder can configure a youtube field to open up in a colorbox modal.
Comment | File | Size | Author |
---|---|---|---|
#26 | Perfection.png | 190.59 KB | jay.lee.bio |
#22 | youtube-colorbox-support-1929652-22.patch | 11.54 KB | guschilds |
Comments
Comment #1
droath CreditAttribution: droath commentedThis patch implements a way for opening YouTube videos in a colorbox modal. You need to make sure you have colorbox enabled, and have "Enable Colorbox load" checked in the colorbox configurations.
Then when choosing a formatter for the YouTube field, select "YouTube thumbnail" and then select "Colorbox" under the "link image to" field. The YouTube video should now display in a colorbox modal when you click the YouTube video thumbnail on a given node.
Comment #2
spanac CreditAttribution: spanac commented@droath
Great idea :) Thank you for the patch
Comment #3
guschilds CreditAttribution: guschilds commentedNice work and thanks for the patch! It worked well for me during a few quick tests and the code looks solid. I don't have much experience with Colorbox so it would be nice for a few folks that use it more often to test it more thoroughly before marking as RTBC. Thanks again!
Comment #4
trebol CreditAttribution: trebol commenteddroath, I apply your patch all the configuration works ok, but in the page where i add youtube field thumbnails with colorbox, the videos are not loading and i get an error message in this line:
'query' => $display['settings']['colorbox']['parameters'],
Piece of code of this part:
Any help to fix it?
Edit: The error is: Notice: Undefined index: colorbox in youtube_field_formatter_view()
Edit 2: I edited the article and delete cache and now works perfectly
Comment #5
kyletaylored CreditAttribution: kyletaylored commentedPatch #1 works great! Great job.
Comment #6
infines CreditAttribution: infines commentedComment #7
ytsejam CreditAttribution: ytsejam commentedWonderful patch, thanks for it! Added a simple option for autoplay (this is my first patch, please be gentle).
Comment #8
Vensdale CreditAttribution: Vensdale commentedPatch #1 works fine. Patch #7 (yeah! autoplay option will be great!) gives an error in patch string 26. I hope colorbox support will be in next youtube field release.
Comment #9
guschilds CreditAttribution: guschilds commentedVensdale is correct. The patch in #7 does not cleanly apply to the 7.x-1.1 release.
Could someone re-roll it? Thanks.
Comment #10
kaztur CreditAttribution: kaztur commentedPatch #1 works fine on my pages with video, great thank You for it. But some notices on /admin/structure/types/manage/my_type/display page:
Below is my youtube.module file (which was checked). Can You help me!
Comment #11
guschilds CreditAttribution: guschilds commentedkaztur,
You're experiencing the bug fixed by the patch in #2 of #2187393: Switching from video to thumbnail as format breaks.
The committed fix has not yet made it into a release, but applying that patch should fix those notices.
Gus
Comment #12
kaztur CreditAttribution: kaztur commentedGreat Thanks, Gus! Those patch works goods for my error.
P.S. I'm sorry, while I loaded my attachment I hide first two ones - I thought they will hide from only my post, but they was hidden from the first post, and I don't know how to return them being visible.
Comment #13
kaztur CreditAttribution: kaztur commentedNow it seems to be good in the first post.
And in the hidden file there's edited for the patch from #1 youtube.module file from 1.1 version.
Comment #14
ytsejam CreditAttribution: ytsejam commentedI had to re-apply the autoplay patch from #7 against the new 1.2 version, and noticed my previous version wasn't prepared good enough, so I applied all the changes by hand and generated a new patch with diff.
I hope it would be OK now, at least works fine for me (drupal 7.26, colorbox 2.5, youtube 1.2).
Comment #15
guschilds CreditAttribution: guschilds commentedComment #16
guschilds CreditAttribution: guschilds commentedI appreciate everyone's work on this.
I was initially hesitant to add this to this module because it strives to maintain simplicity, but then I saw the number of active Colorbox installations. To remain simple while adding this support, I think creating a separate YouTube Field Colorbox module makes sense. The module would still live within the YouTube Field project.
I took the patch from #14 (had to manually apply it) and separated everything out into another module. I made small adjustments and improvements as I went. For example, warning users that 'Enable Colorbox load' must be enabled in the Colorbox module settings. Also, removing the option to not use an iframe for the content because it would never work when chosen.
The patch applies to 1.2. Please give it a try (don't forget to enable YouTube Field Colorbox).
I believe this is at a state where it can be committed after a bit of review.
Thanks again!
Comment #17
Vensdale CreditAttribution: Vensdale commentedCan someone say how can I remove colorbox title overlay on youtube videos? That overlay doesn't allow to control youtube player.
Comment #18
guschilds CreditAttribution: guschilds commentedVensdale,
When I use the patch from #16 and the Colorbox module, I am not able to reproduce what you are seeing. I have tried multiple Colorbox styles and I never get a title bar that covers the YouTube controls on any of them.
I'm guessing the easiest route would be to use CSS rules that override theirs in order to hide that title bar.
Hope that helps.
Gus
Comment #19
jay.lee.bio CreditAttribution: jay.lee.bio commentedGuschilds, #16 works perfectly. Thank you so much!
And as for #17, I think what Vensdale might be referring to is the fact that when you start playing any YouTube video using Colorbox, the header & footer will disappear after a few seconds (which to me looks ok). I attached a couple screenshots taken from my website: http://mediography.by/media/tigris-and-euphrates
Comment #20
jay.lee.bio CreditAttribution: jay.lee.bio commentedComment #21
jay.lee.bio CreditAttribution: jay.lee.bio commentedOne minor issue I wanted to bring up is that unlike the case of multiple images where Colorbox shows the counter that allows you to click through as a gallery, it does not work for multiple YouTube videos. I guess the default Colorbox behavior for this is that clicking is needed for controlling the various buttons in the video shown.
But I thought maybe somebody knew of a solution for videos where Colorbox would show the counter just like images and clicking it specifically will override the default behavior and show the next video?
Comment #22
guschilds CreditAttribution: guschilds commentedJay Lee,
Thanks for testing this.
Your idea to group videos together with the arrows/counter is a good one. I've implemented it in the attached patch, which applies to the latest dev release. After applying it (and clearing cache):
Now all videos on the page should be part of a gallery, as you desire.
Please give that a shot and let me know how it goes. I'd actually like to get this work committed pretty soon.
Thanks!
Gus
Comment #23
guschilds CreditAttribution: guschilds commentedComment #24
jay.lee.bio CreditAttribution: jay.lee.bio commentedGuschilds, I applied the patch in #22 on my test server and it works flawlessly. It's exactly how I envisioned in my mind. Thank you so much!
Comment #25
jay.lee.bio CreditAttribution: jay.lee.bio commentedComment #26
jay.lee.bio CreditAttribution: jay.lee.bio commentedI'm attaching a screenshot, because I noticed that YouTube has also fixed a very minor issue. If you look at the second screenshot from #19, you'll notice that the footer is not completely gone (look at the bits of red & yellow towards the left bottom). That problem is now gone too. :D
Comment #28
guschilds CreditAttribution: guschilds commentedThis has been committed to the project. It can be found in the latest dev release and will be included in the next stable release.
Thanks so much to everyone who provided code, feedback, and testing! Couldn't have done it without ya!
Comment #29
Bikkne CreditAttribution: Bikkne commentedHaven't seen this before, but when I tried to update youtube to the DEV release it might be a corrupt dev upload ?
"drush dl youtube --dev
File youtube-7.x-1.x-dev.tar.gz_date=1407896928 is corrupt (wrong md5 checksum). "
Comment #30
guschilds CreditAttribution: guschilds commentedOdd, Bikkne. I've never seen that before, but it's happening to me too.
I've googled "drupal File is corrupt (wrong md5[error] checksum)." and am finding a lot of threads with very few answers. It seems to happen unpredictably for random projects and eventually goes away. I'll keep my eye on this and hopefully it resolves itself soon.