Hi!
I know the title sound strange but I didn't know how to describe exactly. Here's what I planed: I'm using the iphone-Theme by Jay Matz on my zenphoto installation. I'm also using videos on my gallery wich are only .mp4 Format. iPhone plays them fine but of course there is no Flash support on the iPhone I get the message "Flash installieren" (its german and means install Flash). It would be great if the output of the iphone theme would be something like: if it is an image -> show it ; if it is a .mp4 show a link to the orinal file.
I'm not sure if this is a plugin or a theme thing. Can someone help me with that?
Thanks in advance, lordcoffee
Comments
You would have to modify the theme. You could use this function to sort out video/audio files:
http://www.zenphoto.org/documentation/functions/_functions.php.html#functionisImageVideo
Then you have to get the suffix from the file name and display the full image link to directly play the image instead of the default image.
in the image.php of the iPhone theme there is the following line wich prints the custom sized image. As far as I understood I have to put there something which tells if its an video (.mp4) just print the url to this video instead of the image.
`
<?php
$ls = isLandscape();
printCustomSizedImage(getImageTitle(), null, $ls?604:453, null, null, null, null, null, null, $ls?photoImg_l:photoImg_p);
?>
`
Am I right?
Thanks for your help,
lordcoffee
PS: When I have a finished solution with the "if else" thing I'll post it here of course.
Thank you for addressing the video issue! I'll include this in the theme once you've finished with it. We'll probably want to address thumbnail generation, also. What do you think?
A friend of me helped me with the code. I don't exactly know if this is the best solution but it works fine for me.
On my solution it is necessary to have iphone compatible video format only. I've choosen .mp4 because it's easy to convert (ffmpegx for mac or just quicktime). Your "normal" site view is using an flv-player which already supports .mp4 and in the iphone theme it checks if it is video or image. If it's an image it outputs another image like "click here to view video" with a link to the video. It works fine on my iPhone 3GS.
So here is the code:
`
<?php
if(!isImageVideo())
{
$ls = isLandscape();
printCustomSizedImage(getImageTitle(), null, $ls?604:453, null, null, null, null, null, null, $ls?photoImg_l:photoImg_p);
}
else
{
?>
">
<?
}
?>
`
I've donated a beer to my friend ;-)
Just overwrite the image.php in the iphone theme folder and put the video.png into the images folder inside the iphone theme. Thats all.
Greetings, lordcoffee