I was having problems displaying videos at a normal size in both IE and Firefox, so i have hacked together some code,
Have no idea if it does it's job well or not. You can see it in action at www.myphotoplace.co.uk/random it's the last pic. This method also gets around IE's activeX thing where you have to click to activate.
Firstly you will need to download the flv flash player,
http://www.jeroenwijering.com/upload/flash_flv_player.zipUpload the following files into your zen/ folder
flvplayer.swf
ufo.js
Now open up template-functions.php and add the following line at the beginning of the zenjavascript function;
`
echo "";
`
Now move down to the printDefaultSizedImage function, replace the whole function as below;
`
function printDefaultSizedImage($alt, $class=NULL, $id=NULL) {
// [BEGIN] added by cvogt: check for non image data
$file_full = $_SERVER['DOCUMENT_ROOT'].getFullImageURL();
$file_wo_ext = substr($file_full,0,strrpos($file_full,"."));
if( file_exists( $file_wo_ext.".flv" )){
?>
Get the Flash Player to see this player.
var FO = { movie:"<? echo WEBPATH; ?>/zen/flvplayer.swf",width:"640",height:"480",majorversion:"7",build:"0",bgcolor:"#FFFFFF",
flashvars:"file=<? echo substr(getFullImageURL(),0,strrpos(getFullImageURL(),".")); ?>.flv&showdigits=true&autostart=true&showfsbutton=false" };
UFO.create( FO, "player1");
<?<br />
}
else {
echo "
" width=\"" . getDefaultWidth() . "\" height=\"" . getDefaultHeight() . "\"" .
(($class) ? " class=\"$class\"" : "") .
(($id) ? " id=\"$id\"" : "") . " />";
}
return;
}
`
You will need still a image in your gallery that has the same name as the flv file, for example; pic.jpg and pic.flv this is for the thumbnail.
Comments
function printDefaultSizedImage($alt, $class=NULL, $id=NULL) {
// [BEGIN] added by cvogt: check for non image data
$file_full = $_SERVER['DOCUMENT_ROOT'].getFullImageURL();
$file_wo_ext = substr($file_full,0,strrpos($file_full,"."));
if( file_exists( $file_wo_ext.".flv" )){
?>
<p id="player1">Get the Flash Player to see this player.
<script type="text/javascript">
var FO = { movie:"<? echo WEBPATH; ?>/zen/flvplayer.swf",width:"640",height:"480",majorversion:"7",build:"0",bgcolor:"#FFFFFF",
flashvars:"file=<? echo substr(getFullImageURL(),0,strrpos(getFullImageURL(),".")); ?>.flv&showdigits=true&autostart=true&showfsbutton=false" };
UFO.create( FO, "player1");
</script>
<?
}
else {
echo "<img src=\"" . htmlspecialchars(getDefaultSizedImage()) . "\" alt=\"" . htmlspecialchars($alt, ENT_QUOTES) . "\"" .
" width=\"" . getDefaultWidth() . "\" height=\"" . getDefaultHeight() . "\"" .
(($class) ? " class=\"$class\"" : "") .
(($id) ? " id=\"$id\"" : "") . " />";
}
return;
}
an error that i also found when i tried this hack:
Warning: Division by zero in /home/dakseno/public_html/zenphoto_test106/zen/template-functions.php on line 817
Warning: Division by zero in /home/dakseno/public_html/zenphoto_test106/zen/template-functions.php on line 818
I've uploaded my template-functions.php at the following location > http://www.myphotoplace.co.uk/template-functions.php.file
Can you not try it in a single directory, like www.host.com/zen/ instead of www.host.com/zenphoto_test106/zen/ as i'm not to sure if the paths with be ok.
I say the above because i dont think the lines numbers have much to do with anything i edited, i may be wrong though.
The link to your template-functions.php file is invalid. Would like to get a copy and see where I missed getting it right.
See it in action: http://www.taeglichanders.de/blog/index.php?/wpages/portfolio.html
Just go to the Video section
Download the template-functions.php just here > www.myphotoplace.co.uk/template-functions.file
i know this is far from perfect, but it displays at the correct size in all browsers and you dont need to activate the control in IE
What error message are you getting?
http://www.steelfoot.com/zen/
I rared all the files up and there at http://steelfoot.com/zenphoto.rar
You will need to install it like any other version. If someone wants to make it work with other themes, go for it!
EDIT: looks like the only theme it doesnt show up on is the stopdesign and stoppeddesign. It displays fine on the rest, just need to alter the size.