There were two key features that I needed from FlashVideo and was able to implement by changing a single line of code in the module. That's shown below. However, this change breaks support for multiple thumbnails per video (and maybe breaks other things too). It would be wonderful if the author of this fine module created a "real" way to do the two things, which are:

1. Support for uploaded pictures being used as thumbnails, even if you're not using ffmpeg (in which case the pictures don't get put into the necessary tables(s))

2. Support for thumbnails of type PNG and/or GIF and/or mime type "image/jpeg" (which you get when uploading a JPG and not using ffmpeg). PNGs can have transparency, which JPGs cannot. GIFs can be animated, whereas JPGs cannot.

Here's the old line of code, around line 1562 in the 2008/02/20 version for Drupal 5:

$thumb_file = db_fetch_object(db_query("SELECT f.filepath,f.fid FROM {flashvideo} fv LEFT JOIN {files} f ON f.fid = fv.fid WHERE (f.nid = %d) AND (f.filemime='jpg') AND (fv.video_index=%d)", $nid, $index));

And here's my replacement, with the drawback(s) I mentioned above:

$thumb_file = db_fetch_object(db_query("SELECT f.filepath,f.fid FROM {flashvideo} fv LEFT JOIN {files} f ON f.nid = fv.nid WHERE (f.nid = %d) AND ((f.filemime='jpg') OR (f.filemime LIKE 'image/%'))", $nid));

Would it be possible for you, fine author (or other smart person), to create the benefits of this change without using my ham-handed approach?

Thank you.

Comments

spiffyd’s picture

This is really good, especially when 90+% of all webhosters don't provide FFMPEG. Subscribing.

spiffyd’s picture

Version: 5.x-2.7 » 6.x-1.4-beta

Did you get it working with v6.x?

This line of code (line 1443) is from 6.x-1.4-beta:

<?php
$thumb_file = db_fetch_object(db_query("SELECT filepath,fid FROM {files} WHERE (fid = %d) AND (filemime='jpg')", $fids));
?>

I changed it to...

<?php
$thumb_file = db_fetch_object(db_query("SELECT filepath,fid FROM {files} WHERE (fid = %d) AND (filemime LIKE 'img/%')", $fids));
?>

But I still get no thumbs in both teaser or video.

Any suggestions?

travist’s picture

Status: Active » Postponed (maintainer needs more info)

That might be because you said img/% and not image/%?.... This is a great fix. I might put a check for a FlashVideo thumbnail, and then resort to this if I can't find any. Would this be a good change?

spiffyd’s picture

img was the directory name I used so it's not a typo. But in anycase, if it works, this would be a great feature.

Another idea I thought of as a workaround to those with no FFMPEG and want thumbs is to take advantage of JW Player's flashvars feature that allows you to specify an image for thumbs. There are many ways one can theoretically do this... using an uploaded image (via regular File Uploads, Image Attach mod, etc.) and associating the path to this flashvar.

This may even be featured in Dash Player in the near future.

spiffyd’s picture

@#3: Yes, this would be a great change. Is it included already in the latest release?

attheshow’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closed due to inactivity.