Hi Zenphoto team,
first, a big thanks for your work !
I just upgraded to the lastest version (1.4.3) and now I have a problem for reading/downloading a video file.
In the previous version, I used to copy in the album directory two files for one video : the low quality myvideo.mp4 and the high quality myvideo.wmv (same name but different extension). The mp4 file was readed by flowplayer without problem, and I was able to download the wmv file by clicking on the "download original" button.
With the new version 1.4.3 it does not work anymore
If I copy the two files (MP4 and WMV) flowplayer try to read the wmv instead of the MP4 so I have an error 200 stream not found, and I'm not able to download anything by clicking the "download original" button (http error 500).
I have tryed with only the mp4 file and in this case it work well : flow player read the file and I'm able to download the mp4 file by clicking the "download original" button.
I'm using zenphoto 1.4.3 and zpskeleton 1.4.3 theme.
Thanks for your help !
Eric.
Comments
I have tried with defaut theme and garland theme, same problem, the player try to read the wmv file instead of the mp4 file...
Same problem with jplayer or flowplayer
My previous version was 1.4.1.6, so maybe this is the changes implemented in the 1.4.2 who have created this issue ?
Thanks for your help.
You would have either to write a function to use both even if they are not player (a la if wmv exists link to it), or a plugin to recognize wmv files directly (see the textobject plugin for example) or store the wmv files in the /uploaded folder and link directly to them.
After looking more closely the code, I have found what it has changed between 1.4.1.6 and 1.4.3 : the function getFullImageURL() in template-function.php
If you look the code of getFullImageURL() in v1.4.1.6, you will see that there is a support for download high quality version of a video file in WMV file
in v1.4.3 getFullImageURL() has been changed, and this support is no more available
so my question is : is it a mistake or not ?
Thanks for your help !
ps sorry for my poor english...
To get a unprotected full image you need to use:
a) The image object method of the same name`getFullImageURL()` directly.
or
b) `getUnprotectedImageURL()`(which is located on the template functions right below).
So you will have to modify your theme to use that. But since wmv files were never supported by any player they will notbe recognized anyway and especially not if you are on an image page of an mp4 (Unless you wrote something to change the suffix of course).
This something (a suffixe change) existed in the v1.4.1.6, ans it was an official function, not a custom code :
`
/**
* Returns the url to original image.
* It will return a protected image is the option "protect_full_image" is set
*
* @return string
*/
function getFullImageURL() {
global $_zp_current_image;
if (is_null($_zp_current_image)) return false;
$outcome = getOption('protect_full_image');
if ($outcome == 'No access') return NULL;
if (isImageVideo()) { // Download, Protected View, and Unprotected access all allowed
// Search for a high quality version of the video
$album = $_zp_current_image->getAlbum();
$folder = $album->getFolder();
$video = $_zp_current_image->getFileName();
$video = substr($video, 0, strrpos($video,'.'));
foreach(array(".ogg",".OGG",".avi",".AVI",".wmv",".WMV") as $ext) {
if(file_exists(internalToFilesystem(ALBUM_FOLDER_SERVERPATH.$folder."/".$video.$ext))) {
return ALBUM_FOLDER_WEBPATH. $folder."/".$video.$ext;
}
}
return getUnprotectedImageURL();
} else {
if ($outcome == 'Unprotected') {
return getUnprotectedImageURL();
} else {
return getProtectedImageURL();
}
}
}
`
Is there a good raison to remove this functionnality in the v1.4.3 ? It was very usefull. I know there is no web player who are capable to play WMV, that's why I used the way explained in my first post : for one video published, one MP4 file for being played by the web player, and one high quality WMV for being downloaded only (not played).
At end, even if from now you stop to implement this way, there is still a bug : if in a same album you have 2 files named myvideo.mp4 and myvideo.wmv, when you are on the myvideo.mp4 page the player will try to play myvideo.wmv (and fail), and the download link will not work 'error http 500)... for me it's a bug, and zen photo should ignore the wmv and play/download the mp4.
There has also been some major internal restructuring since 1.4.1.6 to move more things to the object model I don't remember all details of.
So the fix is make this function a custom theme function or a plugin if you need this.
Actually Zenphoto should ignore what it does not support. So that might be a bug but we need to reproduce it. So please open a ticket.
Thanks.