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 '
<p id="player">Get Flash to see this player.
<script type="text/javascript">
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");
</script>';
}`
Result can be seen here: http://www.whodidit.dk/