My profuse thanks to all the developers for a fantastic piece of software. It continually impresses me.
For a recent project, I had to tweak the FLV (FlashVideo) functionality a bit. In the spirit of sharing, here's what I did.
Specifically, I wanted video thumbnails. Currently, to get thumbnails for FLV files, one uploads an FLV file, and a custommade JPEG thumbnail -- both in the same folder and with the same filename. Albums and index pages will show the JPEG as a thumbnail, and the image page will show the FLV file.
What I wanted was to also load this thumbnail as the FLV player default thumbnail: meaning, looking at the image page, there's not only a blank FLV player waiting to be played, but a FLV player showing the thumbnail until play is pressed, at which point the FLV takes over.
To do this, I tweaked version 1.1.5 of zp-core/template-functions.php line 1846 and replaced it with this:
` if ($ext == ".flv") {
//Player Embed...
$videoThumb = preg_replace("/.flv/i", ".jpg", getFullImageURL());
echo '
Get Flash to see this player.
var so = new SWFObject("' . WEBPATH . '/' . ZENFOLDER . '/flvplayer.swf","player","500","395","8");
so.addParam("allowfullscreen","true");
so.addVariable("image","' . $videoThumb . '");
so.addVariable("file","' . getUnprotectedImageURL() . '&title=' . getImageTitle() . '");
so.addVariable("backcolor","0x000000");
so.addVariable("frontcolor","0xffffff");
so.addVariable("lightcolor","0xcccccc");
so.addVariable("displayheight","375");
so.write("player");
';
}`
Result can be seen here: http://www.whodidit.dk/
Comments
Anyway, we will add that feature.
So I figured I'd just post it here, in case you wanted to add it (because I'm that lazy), but it's great to know you'll pick it up. Thanks again.
Ideas for future improvements to this would be to grab the FLV dimensions from the JPEG thumbnail, and add the backcolor, frontcolor, lightcolor and displayheight variables to a plugin options page or something like that.
Again, beautiful beautiful work.
I am not sure if that is a good idea, because not everybody will use exactyl the dimension of the video I would think.
and add the backcolor, frontcolor, lightcolor and displayheight variables to a plugin options page or something like that.
Well, backcolor, frontcolor, screencolor and lightcolor are already in the 1.1.6 plugin...:-)
I have already a draft for a additional flv playlist plugin that uses displayheight/width (I guess you had that in mind, don't you?).