In some cases, there might be a need to display the thumbnail image and on click, load the iframe. The attached patch would allow for this.

To Test:

- Apply the patch.
- Add a youtube field.
- On the display mode, change the display to "Youtube Playable Thumbnail"
- Select your settings.
- Add an entity with the youtube field filled out.
- Go to the entity page, and click on the thumbnail. If the patch is successful, the image is replaced by an iframe on click.

Thanks for taking the time to consider this patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timodwhit created an issue. See original summary.

timodwhit’s picture

FileSize
9.32 KB
guschilds’s picture

Hey Tim,

Thanks for the patch. It no longer applies to the 7.x-1.x branch due to some recent changes, but I re-rolled it (attached) so I could test it out. It does work as advertised. Very cool.

I'm torn on this one because I've had to implement similar functionality (w/o this module) before and seems like a really useful feature. The bummer to me is just how much code is duplicated. A lot of the code for the formatter is the video and thumbnail formatter combined. I spent a little bit of time trying to re-think how this could be done in a way that didn't duplicate so much, but it's difficult based on how the module is structured. I've attached what I ended up on (EDIT: see the patch in #4 for this). It's definitely still rough around the edges and uses some funky tricks to accomplish its goals, but it does work.

I will need to come back to this with fresh eyes at some point and determine if either of these approaches should be committed. If others use either - please chime in!

guschilds’s picture

FileSize
6.74 KB

Woops. I'd made some changes that didn't make it into the "alternate" patch I attached in the previous comment. Attaching the proper patch here (labeled "4" rather than "alternate"). Will hide the alternate one.

guschilds’s picture

Status: Needs review » Closed (won't fix)

Closing after 10 months with no response to the patch feedback and no interest expressed by others. Please reopen if anyone would like to pick up where we left off. Thanks again for the initial patch!