I would like to use this module for the time being before the release of Media vimeo.
Would it be possible to have a formatter for the link field displayoing the vimeo video thumbnail?

Comments

drupalninja99’s picture

+1

drupalninja99’s picture

Here's the actual logic for how to fetch it:

http://stackoverflow.com/questions/1361149/get-img-thumbnails-from-vimeo

I might try to create a patch or something to accomplish this

drupalninja99’s picture

StatusFileSize
new5.06 KB

Alrighty I got this working. Took me a while to figure out d7 formatters. This patch adds the thumbnail formatter with a setting for the thumbnail size, small, medium or large. Works good.

drupalninja99’s picture

Status: Active » Needs review

Changing to needs review

drupalninja99’s picture

StatusFileSize
new1.55 KB

OK I created a 2nd patch to change out file_get_contents which doesnt work with remote urls for drupal_http_request which uses curl. You need both patches for this to work. Anywho someone else can clean up this up, but it does work.

Jerome F’s picture

@jaykali: very nice feature indeed, you did very good! The formatter is now available in manage display for the content types and in views. Well done!

Thanks to you I can now use thumbnails and colorbox trigger to display my videos in a popup.

side note for your patches names the syntax is:
[description]-[issue-number]-[comment-number].patch
vimeo_thumb-1142354-3.patch
vimeo_thumb_httprequest-1142354-5.patch

Jerome F’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new5.02 KB

just a small patch to clean up the code (using coder module)

Line 182: String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms

        $thumb_url = $video_hash[0]['thumbnail_'.$thumb_size];

This patch combines both previous patches and this small typo fix.

Bevan’s picture

Status: Reviewed & tested by the community » Needs work

I do not have time to test the code myself, but am happy to commit clean patches that have been thoroughly peer-tested at least once. This patch passes the peer-test but does not meet coding conventions, mostly with regard whitespace and inline comments, which should always be on their own line, be complete sentences (Capital letter and full stop); http://drupal.org/coding-standards

I wonder if there is an opportunity for code re-use in vimeo_link_formatter_field_formatter_view_vimeo_link_formatter_thumbnail() which appears to be copied, pasted and edited?

Otherwise it looks good.

thebuckst0p’s picture

Thanks Jerome F, I added caching to the thumbnail data so the server doesn't have to do a remote call (relying on a 3rd party server to be up) on every page load. This patch goes on top of yours (#7), not merged. Seems to be working so far. I'm going to add linking to the formatter options as well, like the core image styles.

thebuckst0p’s picture

Added "link to content" and "link to video," patch applies on top of yours in #7 and my previous #9.

I can verify that the patch in #7 works fine, I think caching is pretty important, if someone else wants to give that a 2nd look, (and someone else wants to fix whitespace issues), then it should be good to commit.

thebuckst0p’s picture

It would help if I actually attached the file.

Bevan’s picture

Please provide this as single git patch created from the project's git.drupal.org code repository, so that reviewers may apply the patch simply cloning the git repo and applying one patch: http://drupal.org/node/707484

thebuckst0p’s picture

Status: Needs work » Needs review
StatusFileSize
new6.97 KB

Single git patch re-rolled on the contrib repository. Combines the patches in 7, 9, 12.

Bevan’s picture

Priority: Normal » Major

The patch looks good and clean. Though I do not have time to give it the review it needs and deserves. If a few others test it out and report back I am happy to commit or make thebuckst0p a co-maintainer (if you are willing?)

thebuckst0p’s picture

I don't have time to be a co-maintainer, sorry. I appreciate the work you did on it and hope my patch helped a little.

Ben

JulienD’s picture

Status: Needs review » Reviewed & tested by the community

Thanks guys for this new feature.

I tried the patch #13 and it's works great.

Bevan’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new8.01 KB

I took a closer look at this when I went to commit and saw a few things to tidy up in the patch that I had not noticed before. The updated patch is attached, and is not at all tested. Almost there...

BenK’s picture

Subscribing

markabur’s picture

Missing a comma after '400', patch seems to work if I add that.

+    'loop' => 0,
+    'width' => '400'
+    'height' => '225',
Bevan’s picture

StatusFileSize
new8.01 KB
WorldFallz’s picture

Status: Needs review » Reviewed & tested by the community

patch still applies cleanly, thumbs work great.

I'm happy to help out or be co-maintainer--- i have no intention of installing 3 modules (media, media_vimeo, and emfield) for such a simple function! let's see-- 173kb + 13kb + 9kb or 9kb, lol.

WorldFallz’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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