It's no problem to include a third player option. Please post what you have, I'll have a look into it.
OK, here is what I did, step by step:
* Note: Doing this uses the section of the plugin dedicated to the RphMedia player rather than adding a 3rd option, and effectively removes the RphMedia player.
1. Download the player from
http://flowplayer.org/. As a minimum you need to upload the player file plus the controls file, but I also use the provided "Tube" controls file. I attach the latest version of that one here as the recent update of flowplayer left it a bit tricky to find on their site. Those files need to be uploaded to enlargeit/images/flash/.
2. In enlargeit_source.js find this text:
else
{
var enl_swfsrc = (enl_isie)? ' id="' + enl_img.id+'swfinner" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" data="'+enl_swfpath+'player.swf?movie='+enl_getlongdesc.split('::')[1]+'&autoload=on&fgcolor=0xFF0000&bgcolor=0x000000&volume=70&autorewind=0"' : '';
enl_swfsrc += ' width="' + enl_getlongdesc.split('::')[2] + '" height="' + enl_getlongdesc.split('::')[3] + '"><param name="movie" value="'+enl_swfpath+'player.swf?movie='+enl_getlongdesc.split('::')[1]+'&autoload=on&fgcolor=0xFF0000&bgcolor=0x000000&volume=70&autorewind=0"></param><param name="allowFullScreen" value="true"></param>';
enl_swfsrc += '<embed id="' + enl_img.id+'swfinneremb' + '" src="'+enl_swfpath+'player.swf?movie='+enl_getlongdesc.split('::')[1]+'&autoload=on&fgcolor=0xFF0000&bgcolor=0x000000&volume=70&autorewind=0" type="application/x-shockwave-flash" width="' + enl_getlongdesc.split('::')[2] + '" allowfullscreen="true" height="' + enl_getlongdesc.split('::')[3] + '"></embed></object>';
}
and replace it with:
else
{
var enl_swfsrc = (enl_isie)? 'classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' width=\'' + enl_getlongdesc.split('::')[2] + '\' height=\'' + enl_getlongdesc.split('::')[3] + '\' id=\'single2\' name=\'single2\'' : '';
enl_swfsrc += ' ><param name=\'movie\' value=\''+enl_swfpath+'flowplayer-3.2.2.swf\'><param name=\'allowFullScreen\' value=\'true\'><param name=\'allowscriptaccess\' value=\'always\'><param name=\'flashvars\' value=\'config={\"clip\":{\"url\":\"'+enl_getlongdesc.split('::')[1]+'\",\"autoPlay\":false,\"autoBuffering\":true,\"scaling\":\"fit\"},\"plugins\":{\"controls\":{\"url\": \"'+enl_swfpath+'flowplayer.controls-tube-3.2.1.swf\",\"height\":\"20\",\"timeColor\":\"#D00000\",\"durationColor\":\"#FFFFFF\",\"timeBgColor\":\"#000000\"}},\"canvas\":{\"backgroundColor\":\"#000000\",\"backgroundGradient\":\"[0.1, 0]\"}}\'>';
enl_swfsrc += '<embed type="application/x-shockwave-flash" id="single2" name="single2" src="'+enl_swfpath+'flowplayer-3.2.2.swf" width="' + enl_getlongdesc.split('::')[2] + '" height="' + enl_getlongdesc.split('::')[3] + '" allowscriptaccess="always" allowfullscreen="true" flashvars=\'config={\"clip\":{\"url\":\"'+enl_getlongdesc.split('::')[1]+'\",\"autoPlay\":false,\"autoBuffering\":true,\"scaling\":\"fit\"},\"plugins\":{\"controls\":{\"url\": \"'+enl_swfpath+'flowplayer.controls-tube-3.2.1.swf\",\"height\":\"20\",\"timeColor\":\"#D00000\",\"durationColor\":\"#FFFFFF\",\"timeBgColor\":\"#000000\"}},\"canvas\":{\"backgroundColor\":\"#000000\",\"backgroundGradient\":\"[0.1, 0]\"}}\'/></object>';
}
This leaves some of the many options "hard coded" and a gold plated solution would be to have them all configurable via the plugin interface (but I didn't need that so didn't do it).
3. Grab the newly saved js text in the source file (all of the file except the very top part, as indicated in the comments), paste it into a js compress tool and then paste the output text from that tool into the enlargeit.js file.
4. Edit the CASE 2 section of codebase.php to this:
// CASE 2: flash or movie
elseif (in_array($enl_filetyplower, $movie_array) == TRUE) {
$pid = $thumb['pid'];
// For flash or movie files we need some more data from the database
$result = cpg_db_query("SELECT aid from {$CONFIG['TABLE_PICTURES']} WHERE pid='$pid' LIMIT 1");
$row = mysql_fetch_array($result);
$album = $row['aid'];
$pic_data = get_pic_data($album, $pic_count, $album_name, -1, -1, false);
for($pos = 0; $pic_data[$pos]['pid'] != $pid && $pos < $pic_count; $pos++); {
$pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false);
}
$CURRENT_PIC_DATA = $pic_data[0];
if ($CURRENT_PIC_DATA['pwidth'] == 0) {
$CURRENT_PIC_DATA['pwidth'] = 500;
}
if ($CURRENT_PIC_DATA['pheight'] == 0) {
$CURRENT_PIC_DATA['pheight'] = 410;
}
//the next single line corrects the viewer size in Flowplayer allowing for use of a player control panel set at 20px high
$CURRENT_PIC_DATA['pheight'] = $CURRENT_PIC_DATA['pheight'] + 20;
if ($enl_filetyplower == 'swf') {
$enl_newthumb = '<img src="images/thumbs/thumb_swf.png" class="enlargeimg" width="'.$thumb['pwidth'].'" height="'.$thumb['pheight'].'" ';
} else {
// $enl_newthumb = '<img src="images/thumbs/thumb_movie.png" class="enlargeimg" width="'.$thumb['pwidth'].'" height="'.$thumb['pheight'].'" ';
$mrdeefilename = $thumb['filename'];
$mrdeethumext = ".jpg";
$mrdeefilename = substr($mrdeefilename, 0, (strlen ($mrdeefilename)) - (strlen (strrchr($mrdeefilename,'.'))));
$enl_newthumb = '<img src="' . $CONFIG['fullpath'] . $thumb['filepath'] . $CONFIG['thumb_pfx'] . $mrdeefilename . $mrdeethumext . '" ';
$enl_newthumb .= 'class="enlargeimg" ';
if (($CONFIG['thumb_use'] == 'any' && $thumb['pwidth'] >= $thumb['pheight']) || $CONFIG['thumb_use'] == 'wd') {
$enl_thumbheight = round($thumb['pheight'] / $thumb['pwidth'] * $CONFIG['thumb_width']);
$enl_newthumb .= 'width="' . $CONFIG['thumb_width'] . '" height="' . $enl_thumbheight . '" ';
} elseif (($CONFIG['thumb_use'] == 'any' && $thumb['pwidth'] < $thumb['pheight']) || $CONFIG['thumb_use'] == 'ht') {
$enl_thumbwidth = round($thumb['pwidth'] / $thumb['pheight'] * $CONFIG['thumb_width']);
$enl_newthumb .= 'width="' . $enl_thumbwidth . '" height="' . $CONFIG['thumb_width'] . '" ';
}
$enl_newthumb .= 'border="0" onclick="enlarge(this);" ';
if ($enl_filetyplower == 'swf') {
$enl_newthumb .= 'longdesc="swf::'.path2url($enl_path).'::'.$CURRENT_PIC_DATA['pwidth'].'::'.$CURRENT_PIC_DATA['pheight'].'" ';
} elseif ($enl_filetyplower == 'flv') {
if ($CONFIG['plugin_enlargeit_flvplayer'] == '0') {
$enl_newthumb .= 'longdesc="fl2::'.path2url($enl_path).'::'.$CURRENT_PIC_DATA['pwidth'].'::'.$CURRENT_PIC_DATA['pheight'].'" ';
} else {
$enl_newthumb .= 'longdesc="flv::'.path2url($enl_path).'::'.$CURRENT_PIC_DATA['pwidth'].'::'.$CURRENT_PIC_DATA['pheight'].'" ';
}
} elseif ($enl_filetyplower == 'dvx') {
$enl_newthumb .= 'longdesc="dvx::'.path2url($enl_path).'::'.$CURRENT_PIC_DATA['pwidth'].'::'.$CURRENT_PIC_DATA['pheight'].'" ';
}
$enl_newthumb .= 'name="'.$thumb['pid'].'" alt="" title="'.$thumb['title'].'" />';
$more_params = array(
'{LINK_ONCLICK}' => 'onclick="return false;"',
'{THUMB}' => $enl_newthumb,
);
}
}
5. When I upload a movie I do it via the batch add tool. I use the thumb file which comes from my camera, after renaming it giving it the thum prefix as per the setup of the coppermine config. The name after the prefix needs to match the name given to the uploaded movie file. The batch add process then links the thum to the movie automatically.
6. The final step is to edit the movie file dimensions (width/height) in the properties of the uploaded image. I tend to compress my movies in H.264 but leave them at full 1080P in terms of physical pixel dimensions. This makes them look very good when you play them back in the player at full screen. However, I set the properties in the image to initially play them at 881x496, which makes for a popup box in enlargeit which suits the majority of screen resolutions.
The last two steps are needed irrespective of using Enlargeit.