video in Zenphoto how?

Maybe I'm being a little dense here. I got everything set up with no problems. Images are a piece of cake but just how do you load and view videos? Is something extra I need to get?

Comments

  • lt Member
    Like I said I was being dense. Incase someone else is having problems. Just manually load with ftp a video in your album along with a thumbnail image. For thumbnail to work the video and thumbnail must have the same name. For example if video is named video.flv the thumbnail must be named video.jpg.
  • blancy Member
    thanks for that. I hadn't been able to work it out :)
    was trying to upload video with the admin panel
  • Hi:

    I have been reading your entire forum on this topic. I did precisely what the instructions said.

    Here is it step by step.

    I created an album for video
    everything is chmod 777
    I converted a wmv to flv
    I created a thumbnail with the same name as the flv file
    I uploaded both files to the folder designated for the video
    I go to my album and neither the thumbnail nor the video are showing anywhere, the only thumbnail is the generic zenphoto one.

    Since I have followed all instructions, what is the problem? Can anyone help?

    Thanks
  • acrylian Administrator, Developer
    Please check on the plugin page if either flvplayer or flowplayer are enabled.
  • I have flvplayer v1.0.2.8.2
    and flv_playlist v1.0.4.2 enabled
    the flowplayer is disabled

    and nothing still
  • ok fixed.

    I had uploaded it into the cache folder as opposed to the albums folder. <slapping head>
  • Kate52 Member
    How can I add a one of the longtail skins to the flvplayer?
  • acrylian Administrator, Developer
    You will have to modify the flvplayer plugin.
  • I'm interested in this too. Could you please elaborate a little more? Which files should I modify to change a skin?
  • acrylian Administrator, Developer
    You need to modify `zp-core/plugins/flvplayer.php` (obviously, isn't it?..:-)).
  • D'oh! I was looking inside the flvplayer folder. That's why I couldn't find the right file.
    Thanks acrylian :)
  • Ok, I'm stuck. I want to change the default skin to dangdang.swf but everything I've tried is not working, here's what my file looks right now (sorry about the lenght):
    `
    <?php
    /**
    * flvplayer -- plugin support for the flvplayer flash video player. Support for version 3 and 4.
    *
    * Note: 1.1 now incorporates the former separate flv_playlist plugin to show the content of an media album with .flv/.mp4/.mp3 movie/audio files as a playlist or as separate players with flv player. Note:</strong>Currently internally uses FLV player version 3 because of API incompatiblity with version 4.
    *
    * IMPORTANT: Flash players do not support external albums!
    *
    * @author Malte Müller (acrylian), Stephen Billard (sbillard)
    * @version 1.1.1
    * @package plugins
    */

    $plugin_description = ($external = (getOption('album_folder_class') === 'external'))? gettext('Flash players do not support External Albums!'): gettext("Enable FLV player to handle multimedia files. IMPORTANT: Only one multimedia player plugin can be enabled at the time.Version 1.1. now incorporates the flv_playlist plugin to show the content of an media album with .flv/.mp4/.mp3 movie/audio files only as a playlist or as separate players with flv player.Note:Currently supports only FLV player version 3. NOTE: You need to buy a licence from the player's developer LongTail Video if you intend to use this plugin for commercial purposes. Please see LongTail Video - JW players for more info about the player and its licence.");
    $plugin_author = "Malte Müller (acrylian), Stephen Billard (sbillard)";
    $plugin_version = '1.1.1';
    $plugin_URL = "http://www.zenphoto.org/documentation/plugins/_plugins---flvplayer.php.html";
    $plugin_disable = $external;
    $option_interface = new flvplayer();
    $_zp_flash_player = $option_interface; // claim to be the flash player.

    if ($external) return; // can't process external album images

    // register the scripts needed
    addPluginScript('');

    define ('FLV_PLAYER_MP3_HEIGHT', 20);
    /**
    * Plugin option handling class
    *
    */
    class flvplayer {

    function flvplayer() {
    setOptionDefault('flv_player_width', '320');
    setOptionDefault('flv_player_height', '240');
    setOptionDefault('flv_player_backcolor', '#FFFFFF');
    setOptionDefault('flv_player_frontcolor', '#000000');
    setOptionDefault('flv_player_lightcolor', '#000000');
    setOptionDefault('flv_player_screencolor', '#000000');
    setOptionDefault('flv_player_displayheight', '240');
    setOptionDefault('flv_player_autostart', '');
    setOptionDefault('flv_player_buffer','0');
    setOptionDefault('flv_player_version','player3');
    setOptionDefault('flv_player_controlbar','over');
    //setOptionDefault('flv_player_ignoresize_for_mp3', 'true');

    // flv_playlist options
    setOptionDefault('flvplaylist_width', '600');
    setOptionDefault('flvplaylist_height', '240');
    setOptionDefault('flvplaylist_displaywidth', '320');
    setOptionDefault('flvplaylist_displayheight', '240');
    setOptionDefault('flvplaylist_thumbsinplaylist', '');
    }

    function getOptionsSupported() {
    $result = array( gettext('flv player width') => array('key' => 'flv_player_width', 'type' => 0,
    'desc' => gettext("Player width (ignored for mp3 files.)")),
    gettext('flv player height') => array('key' => 'flv_player_height', 'type' => 0,
    'desc' => gettext("Player height (ignored for .mp3 files if there is no preview image available.)")),
    gettext('Displayheight') => array('key' => 'flv_player_displayheight', 'type' => 0,
    'desc' => gettext("The height of the player display. Generally it should be the same as the height. (ignored for .mp3 files if there is no preview image available.)")),
    gettext('Autostart') => array('key' => 'flv_player_autostart', 'type' => 1,
    'desc' => gettext("Should the video start automatically. Yes if selected.")),
    gettext('BufferSize') => array('key' => 'flv_player_buffer', 'type' => 0,
    'desc' => /*xgettext:no-php-format*/ gettext("Size of the buffer in % before the video starts.")),
    gettext('FLV Player version') => array('key' => 'flv_player_version', 'type' => 5,
    'selections' => array(gettext('Version 3')=>"player3", gettext('Version 4')=>"player4"),
    'desc' => gettext("The FLV Player version to be used. Note that due to API changes version 3 and 4 support not all the same options as noted.")),
    gettext('Controlbar position') => array('key' => 'flv_player_controlbar', 'type' => 5,
    'selections' => array(gettext('Bottom')=>"bottom", gettext('Over')=>"over", gettext('None')=>"none"),
    'desc' => gettext("The position of the controlbar. Player version 4 only!")),
    gettext('Playlist Width') => array('key' => 'flvplaylist_width', 'type' => 0,
    'desc' => gettext("Player width for the playlist")),
    gettext('Playlist Height') => array('key' => 'flvplaylist_height', 'type' => 0,
    'desc' => gettext("Player height for the playlist (ignored for .mp3 files if there is no preview image available.)")),
    gettext('Playlist Displaywidth') => array('key' => 'flvplaylist_displaywidth', 'type' => 0,
    'desc' => gettext("Display width for the playlist. The display width is needed for the playlist menu to be shown. In this case the 'displaywidth - width = width of the playlist menu'. See the flv player site for more info about these options.")),
    gettext('Playlist Displayheight') => array('key' => 'flvplaylist_displayheight', 'type' => 0,
    'desc' => gettext("Display height for the playlist. If the width is too small to show the playlist menu, you can set the height higher to show it below the actual movie display. See the flv player site for more info about these options.")),
    gettext('Playlist Thumbs in playlist') => array('key' => 'flvplaylist_thumbsinplaylist', 'type' => 1,
    'desc' => gettext("Check if you want that thumbnails of the preview images should be shown in the playlist."))
    );

    if (getOption('flv_player_version') == 'player3') {
    $result = array_merge($result,
    array( gettext('Backcolor') => array('key' => 'flv_player_backcolor', 'type' => 8,
    'desc' => gettext("Backgroundcolor of the controls, in HEX format. Player version 3 only!")),
    gettext('Frontcolor') => array('key' => 'flv_player_frontcolor', 'type' => 8,
    'desc' => gettext("Texts & buttons color of the controls, in HEX format. Player version 3 only!")),
    gettext('Lightcolor') => array('key' => 'flv_player_lightcolor', 'type' => 8,
    'desc' => gettext("Rollover color of the controls, in HEX format. Player version 3 only!")),
    gettext('Screencolor') => array('key' => 'flv_player_screencolor', 'type' => 8,
    'desc' => gettext("Color of the display area, in HEX format. Player version 3 only!"))
    ));
    };

    return $result;
    }

    /**
    * Prints the JS configuration of flv player
    *
    * @param string $moviepath the direct path of a movie (within the slideshow), if empty (within albums) the zenphoto function getUnprotectedImageURL() is used
    * @param string $imagetitle the title of the movie to be passed to the player for display (within slideshow), if empty (within albums) the function getImageTitle() is used
    * @param string $count unique text for when there are multiple player items on a page
    */
    function getPlayerConfig($moviepath='',$imagetitle='',$count ='') {
    global $_zp_current_image, $_zp_current_album;
    if(empty($moviepath)) {
    $moviepath = getUnprotectedImageURL();
    $ext = strtolower(strrchr(getUnprotectedImageURL(), "."));
    } else {
    $ext = strtolower(strrchr($moviepath, "."));
    }
    if(empty($imagetitle)) {
    $imagetitle = getImageTitle();
    }
    if(!empty($count)) {
    $count = "-".$count;
    }
    $imgextensions = array(".jpg",".jpeg",".gif",".png");
    if(is_null($_zp_current_image)) {
    $albumfolder = $moviepath;
    $filename = $imagetitle;
    $videoThumb = '';
    } else {
    $album = $_zp_current_image->getAlbum();
    $albumfolder = $album->name;
    $filename = $_zp_current_image->filename;
    $videoThumb = checkObjectsThumb(getAlbumFolder().$albumfolder, $filename);
    if (!empty($videoThumb)) {
    $videoThumb = getAlbumFolder(WEBPATH).$albumfolder.'/'.$videoThumb;
    }
    }
    $output = '';
    $output .= '

    '.gettext("Get Flash").' to see this player.

    ';
    if($ext === ".mp3" AND !isset($videoThumb)) {
    $output .= ' var so = new SWFObject("' . WEBPATH . '/' . ZENFOLDER .PLUGIN_FOLDER . 'flvplayer/'.getOption("flv_player_version").'.swf","player'.$count.'","'.getOption('flv_player_width').'","'.FLV_PLAYER_MP3_HEIGHT.'","7");';
    } else {
    $output .= ' var so = new SWFObject("' . WEBPATH . '/' . ZENFOLDER .PLUGIN_FOLDER . 'flvplayer/'.getOption("flv_player_version").'.swf","player'.$count.'","'.getOption('flv_player_width').'","'.getOption('flv_player_height').'","7");';
    $output .= 'so.addVariable("displayheight","'.getOption('flv_player_displayheight').'");';
    }
    $output .= 'so.addParam("allowfullscreen","true");
    so.addVariable("file","' . $moviepath . '&title=' . strip_tags($imagetitle) . '");
    ' . (!empty($videoThumb) ? 'so.addVariable("image","' . $videoThumb . '")' : '') . '
    so.addVariable("backcolor","'.getOption('flv_player_backcolor').'");
    so.addVariable("skin","/zen/zp-core/plugins/flvplayer/dangdang.swf");
    so.addVariable("frontcolor","'.getOption('flv_player_frontkcolor').'");
    so.addVariable("lightcolor","'.getOption('flv_player_lightcolor').'");
    so.addVariable("screencolor","'.getOption('flv_player_screencolor').'");
    so.addVariable("autostart","' . (getOption('flv_player_autostart') ? 'true' : 'false') . '");
    so.addVariable("overstretch","true");
    so.addVariable("bufferlength","'.getOption('flv_player_buffer').'");
    so.addVariable("controlbar","'.getOption('flv_player_controlbar').'");
    so.write("player'.$count.'");
    ';
    return $output;
    }

    /**
    * outputs the player configuration HTML
    *
    * @param string $moviepath the direct path of a movie (within the slideshow), if empty (within albums) the zenphoto function getUnprotectedImageURL() is used
    * @param string $imagetitle the title of the movie to be passed to the player for display (within slideshow), if empty (within albums) the function getImageTitle() is used
    * @param string $count unique text for when there are multiple player items on a page
    */
    function printPlayerConfig($moviepath='',$imagetitle='',$count ='') {
    echo $this->getPlayerConfig($moviepath,$imagetitle,$count);
    }

    /**
    * Returns the height of the player
    * @param object $image the image for which the width is requested
    *
    * @return int
    */
    function getVideoWidth($image=NULL) {
    return getOption('flv_player_width');
    }

    /**
    * Returns the width of the player
    * @param object $image the image for which the height is requested
    *
    * @return int
    */
    function getVideoHeigth($image=NULL) {
    if (!is_null($image) && strtolower(strrchr($image->filename, ".") == '.mp3')) {
    return FLV_PLAYER_MP3_HEIGHT;
    }
    return getOption('flv_player_height');
    }

    /**
    * Returns the file extension if the item passed is displayable by the player
    *
    * @param mixed $image either an image object or the filename of an image.
    * @return string;
    */
    function is_valid($image) {
    $valid_types = array('jpg','jpeg','gif','png','mov','3gp','flv','mp3','mp4');
    if (is_object($image)) $image = $image->filename;
    $ext = getSuffix($image);
    if (in_array($ext, $valid_types)) {
    return $ext;
    }
    return false;
    }
    }

    /**
    * To show the content of an media album with .flv/.mp4/.mp3 movie/audio files only as a playlist or as separate players with flv player
    * NOTE: The flv player plugin needs to be installed (This plugin currently internally uses FLV player 3 because of FLV player 4 Api changes!)
    *
    * The playlist is meant to replace the 'next_image()' loop on a theme's album.php.
    * It can be used with a special 'album theme' that can be assigned to media albums with with .flv/.mp4/.mp3s

    * movie/audio files only. See the examples below
    * You can either show a 'one player window' playlist or show all items as separate players paginated

    * (set in the settings for thumbs per page) on one page (like on a audio or podcast blog).
    *
    * If there is no preview image for a mp3 file existing only the player control bar is shown.
    *
    * The two modes:
    * a) 'playlist'
    * Replace the entire 'next_image()' loop on album.php with this:
    * <?php flvPlaylist("playlist"); ?>
    *
    * b) 'players'
    * Modify the 'next_image()' loop on album.php like this:
    * <?php
    * while (next_image(false,$firstPageImages)):
    * printImageTitle();
    * flvPlaylist("players");
    * endwhile;
    * ?>
    * Of course you can add further functions to b) like title, description, date etc., too.
    *
    * @param string $option the mode to use "playlist" or "players"
    */
    function flvPlaylist($option='') {
    global $_zp_current_album, $_zp_current_image;
    if(checkAlbumPassword($_zp_current_album->getFolder(), $hint)) {
    if($option === "players") {
    $moviepath = getUnprotectedImageURL();
    $ext = strtolower(strrchr(getUnprotectedImageURL(), "."));
    }
    $imagetitle = getImageTitle();
    }
    $albumid = getAlbumID();

    switch($option) {
    case "playlist":

    if(getNumImages() != 0) {
    ?>

    <?php echo gettext("The flv player is not installed. Please install or activate the flv player plugin."); ?>


    var so = new SWFObject('<?php echo WEBPATH."/".ZENFOLDER.PLUGIN_FOLDER; ?>flvplayer/player3.swf','jstest','<?php echo getOption('flvplaylist_width'); ?>','<?php echo getOption('flvplaylist_height'); ?>','8');
    so.addParam('allowfullscreen','true');
    so.addParam('overstretch','true');
    so.addVariable('displaywidth', '<?php echo getOption('flvplaylist_displaywidth'); ?>');
    so.addVariable('displayheight','<?php echo getOption('flvplaylist_displayheight'); ?>');
    so.addVariable('backcolor','<?php echo getOption('flv_player_backcolor'); ?>');
    so.addVariable('frontcolor','<?php echo getOption('flv_player_frontcolor'); ?>');
    so.addVariable('lightcolor','<?php echo getOption('flv_player_lightcolor'); ?>');
    so.addVariable('screencolor','<?php echo getOption('flv_player_screencolor'); ?>');
    so.addVariable('file','<?php echo WEBPATH."/".ZENFOLDER.PLUGIN_FOLDER; ?>flvplayer/playlist.php?albumid=<?php echo $albumid; ?>');
    so.addVariable('javascriptid','jstest');
    so.addVariable('enablejs','true');
    so.addVariable('thumbsinplaylist','<?php echo (getOption('flvplaylist_thumbsinplaylist') ? 'true' : 'false') ?>');
    so.write('flvplaylist');

    <?php }
    break;

    case "players":
    if (($ext == ".flv") || ($ext == ".mp3") || ($ext == ".mp4")) {
    echo "<div id=\"flvplaylist-".$imagetitle."\">".gettext("The flv player is not installed. Please install or activate the flv player plugin..")."";

    // check if an image/videothumb is available - this shouldn't be hardcoded...
    $album = $_zp_current_image->getAlbum();
    $videoThumb = checkObjectsThumb($album->localpath, $_zp_current_image->filename);
    if (!empty($videoThumb)) {
    $videoThumb = getAlbumFolder(WEBPATH).$album->name.'/'.$videoThumb;
    }
    ?>

    <?php

    if(($ext == ".mp3") && empty($videoThumb)) {
    ?>
    var so = new SWFObject('<?php echo WEBPATH."/".ZENFOLDER.PLUGIN_FOLDER; ?>flvplayer/player3.swf','jstest','<?php echo getOption('flvplaylist_width'); ?>','20','8');
    <?php } else { ?>
    var so = new SWFObject('<?php echo WEBPATH."/".ZENFOLDER.PLUGIN_FOLDER; ?>flvplayer/player3.swf','jstest','<?php echo getOption('flvplaylist_width'); ?>','<?php echo getOption('flvplaylist_height'); ?>','8');
    <?php } ?>
    so.addParam('allowfullscreen','true');
    so.addParam('overstretch','true');
    so.addVariable("image",'<?php echo $videoThumb; ?>');
    so.addVariable('backcolor','<?php echo getOption('flv_player_backcolor'); ?>');
    so.addVariable('frontcolor','<?php echo getOption('flv_player_frontcolor'); ?>');
    so.addVariable('lightcolor','<?php echo getOption('flv_player_lightcolor'); ?>');
    so.addVariable('screencolor','<?php echo getOption('flv_player_screencolor'); ?>');
    so.addVariable('file','<?php echo $moviepath; ?>');
    so.addVariable('javascriptid','jstest');
    so.addVariable('enablejs','true');
    so.write('flvplaylist-<?php echo escape($imagetitle); ?>');
    <?php } ?>

    <?php
    break;
    }
    } // password check end
    ?>
    `
  • acrylian Administrator, Developer
    Well, I am not familiar with skins of the flvplayer (never tried it actually). You need to add a parameter (adVariable) for "skin" if I am not mistaken by the players documentation.
Sign In or Register to comment.