Prettyphoto for avi and mp4
  • hi, I'm just started with pretty photo plug in.

    It works fine for flv and swf files.but it shows 'image cannot be loaded' when i try to display avi and mp4 videos.Please help me.
  • I modified my prettyphoto.js by changing this function. It doesn't have cases for avi and mp4 by default so it assumes the files are images. Change it like this and it should work.

    function _getFileType(itemSrc){
    if (itemSrc.match(/youtube\.com\/watch/i)) {
    return 'youtube';
    }else if (itemSrc.match(/vimeo\.com/i)) {
    return 'vimeo';
    }else if(itemSrc.indexOf('.mov') != -1){
    return 'quicktime';
    }else if(itemSrc.indexOf('.avi') != -1){
    return 'quicktime';
    }else if(itemSrc.indexOf('.mp4') != -1){
    return 'quicktime';
    }else if(itemSrc.indexOf('.swf') != -1){
    return 'flash';
    }else if(itemSrc.indexOf('iframe') != -1){
    return 'iframe'
    }else if(itemSrc.substr(0,1) == '#'){
    return 'inline';
    }else{
    return 'image';
    };
    };
  • Hi, Ive tried to put any type of video content(flv, mov, swf) using prettyphoto and none of them will work. Ive changed my js file to what you said bmeier and it is still not working.

    Am I putting the code in wrong?



    Please any info will be of great value!
    Thanks
  • Thank you for the help bmeier.

    I replace js file with the above code, and it works. And i include

    else if(itemSrc.indexOf('.flv') != -1){
    return 'flv';
    for flv to play.


    Everything is fine now.

    @shana: I used rel="prettyPhoto[flash]" and it works for me.
    Thanks.
  • @shana

    Here is a sample line from a working site I made (it looks very similar to yours):


    The word in the square brackets following prettyphoto in the rel area ("group2" in my case) does not determine how to play the file type. It simply tells prettyphoto that every item with that exact text is in the same slideshow. I would make sure your video is visible at the url you are attempting to include in the href.

    @cuckoo
    You may run in to problems if you use the code you included (return 'flv';) If you look at the $.prettyPhoto.open function there is no case for handling 'flv', if there are errors try doing:
    return 'flash';

    Good luck!
  • Er, so I applied the above patch, but my mp4's and m4v's don't play. If I remove rel="prettyPhoto" then the videos play, just not prettily. Clearly something else is wrong. But what?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter