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
Comment #1
spiffyd commentedThis is really good, especially when 90+% of all webhosters don't provide FFMPEG. Subscribing.
Comment #2
spiffyd commentedDid you get it working with v6.x?
This line of code (line 1443) is from 6.x-1.4-beta:
I changed it to...
But I still get no thumbs in both teaser or video.
Any suggestions?
Comment #3
travist commentedThat 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?
Comment #4
spiffyd commentedimg 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.
Comment #5
spiffyd commented@#3: Yes, this would be a great change. Is it included already in the latest release?
Comment #6
attheshow commentedClosed due to inactivity.