forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: rphMedia on April 18, 2007, 02:40:41 pm

Title: Another FLV Player
Post by: rphMedia on April 18, 2007, 02:40:41 pm
This is a basic FLV Player similar to this mod HERE (http://forum.coppermine-gallery.net/index.php?topic=34182.0) but I've included the player in the attached file along with the flashobject.js (eliminates the IE message to activate the object).

Firstly you'll need Nibbler's Filetype Editor Plugin (http://forum.coppermine-gallery.net/index.php?topic=24186.msg111120)

Add the filetype "flv     application/x-shockwave-flash     movie     Flash Player"

Modify theme.php (ensure the function theme_html_picture() exists).

Find:
Code: [Select]
$player = $players[$user_player];

        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }
Replace with:
Code: [Select]
$player = $players[$user_player];
       
if ($mime_content['extension'] == "flv") {
$descript = $CURRENT_PIC_DATA['title'];
if ($CURRENT_PIC_DATA['pheight']==240) { // if no file information edit, use default width/height below
$CURRENT_PIC_DATA['pheight'] = 270; // default FLV height
$CURRENT_PIC_DATA['pwidth'] = 330; // default FLV width
}
$pic_html = '<script type="text/javascript" src="flashobject.js"></script><div id="flashcontent"></div><script type="text/javascript">var fo = new FlashObject("flvPlayer.swf", "animationName", "' . $CURRENT_PIC_DATA['pwidth'] . '", "' . $CURRENT_PIC_DATA['pheight'] . '", "8", "#FFFFFF"); fo.addParam("allowScriptAccess", "sameDomain"); fo.addParam("quality", "best");fo.addParam("FlashVars", "flvPath=' . $picture_url . '&flvTitle=' . $descript . '"); fo.addParam("allowFullScreen", "true"); fo.write("flashcontent");</script>';
} else {
        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= '<param name="src" value="' . $picture_url . '" /><param name="ShowControls" value="1" /><param name="ShowStatusBar" value="1" /><param name="ShowDisplay" value="0" /><param name="DisplaySize" value="0" /><param name="allowFullScreen" value="true" /><param name="autostart" value="' . $autostart . '" />';
        $pic_html .= '<embed '.$image_size['whole'].' src="' . $picture_url . '" allowFullScreen="true" '.' autostart="' . $autostart . '" ' . $player['mime'] . '></embed></object><br />\n';
    }
}

Place the 2 files (flvPlayer.swf & flashobject.js) in the gallery root.

You can see an example of this player HERE (http://www.muvipix.com/gallery/displayimage.php?pos=-205) & HERE (http://gallery.rphmedia.net/displayimage.php?pos=-263)

There's also a client-side player I made HERE (http://www.muvipix.com/gallery/displayimage.php?pos=-700) for testing the FLVs or what have you.  Just launch the program from the folder the FLVs are in or select a folder with FLVs and they will auto-play.

Enjoy !

Edit: Modified code to allow changing the size of the movie. Also "fullscreen" capability (right-click).
Title: Re: Another FLV Player
Post by: Hein Traag on April 18, 2007, 02:45:19 pm
Nice work rph!
Title: Re: Another FLV Player
Post by: freeedy on April 23, 2007, 04:59:21 pm
Nice player dude, I just have 2 questions.
Is it possible to use this same player for swf? The thing is that I will like to have that same menu controls for playing those files.
And the second, this player change the resolution of the flvs? or they will use any different size that I put, since I have several flv with different resolutions

Thanks friend
Title: Re: Another FLV Player
Post by: rphMedia on April 23, 2007, 10:40:17 pm
First question, no. I mean, it can probably be done, but it's beyond the concept of this mod.

Second question (try to keep it to one question per thread/post) - I can make the player autosize if that's what you want.  It presently scales the video, but if you really need it to, I can modify the player to scale to resolution.

Title: Re: Another FLV Player
Post by: freeedy on April 24, 2007, 12:23:48 am
Actually I was expecting not to be scaled, any its fine by me, I havent convert the videos yet, so know that I know they are scaled I will convert them all to the same resolution, since it wont be of any use to have them bigger. Thanks pal.
Title: Re: Another FLV Player
Post by: freeedy on April 24, 2007, 12:37:15 am
I was looking in the other flv player, and in that thread they have like a suggestion to slightly modify the script and get larger resolutions, will that change will work with your mod too?
However, in that thread their is also one guy that made the change and he argues that the bigger flv worked well, but the ones with smaller resolution start working oldly. Will this also happen in your mod?
Title: Re: Another FLV Player
Post by: danwanner on May 16, 2007, 04:36:44 pm
*Another FLV Player* is a very nice player!!!

I'd like to install the player. However, the instruction *Modify theme.php (ensure the function theme_html_picture() exists).* does not apply to my configuration.

The *theme_html_picture()*  function is in *includes/functions.inc.php*. Will editing the *functions.inc.php* file satisfy the change in code referenced by the above instruction?

Thanks for your help.

dbw@danwanner.com
Title: Re: Another FLV Player
Post by: Joachim Müller on May 16, 2007, 06:20:03 pm
theme_html_picture()*  function is in *includes/functions.inc.php*. Will editing the *functions.inc.php* file satisfy the change in code referenced by the above instruction?
Definitely not in cpg1.4.x - you must be using an unsupported version! Post a link to your gallery if you are actually running cpg1.4.x
If the function theme_html_picture() doesn't exist in themes/yourtheme/theme.php, copy it from themes/sample/theme.php as suggested.
Title: Re: Another FLV Player
Post by: danwanner on May 16, 2007, 07:07:12 pm
Here's the link.

http://www.paavtours.com/cpg42999/index.php

Thnks.
Title: Re: Another FLV Player
Post by: rphMedia on May 19, 2007, 02:09:02 pm
Here's the link.

http://www.paavtours.com/cpg42999/index.php
Link is broken.
Title: Re: Another FLV Player
Post by: haga45 on May 20, 2007, 08:09:57 pm
Question - I have FLV videos at the 480x360 resolution... will these look ok with your player (sized at lower resolution) and look ok, or can I adjust the size in the PHP code you provided and still have things work ok?

Thanks for taking the time to provide this!!
Title: Re: Another FLV Player
Post by: rphMedia on May 20, 2007, 08:50:32 pm
Question - I have FLV videos at the 480x360 resolution... will these look ok with your player (sized at lower resolution) and look ok, or can I adjust the size in the PHP code you provided and still have things work ok?

I think it would look fine, but if you want to change the size of the player permanantly, just input the dimensions in this line (2 places):

Change:
Code: [Select]
$pic_html = "<script type=\"text/javascript\" src=\"flashobject.js\"></script><div id=\"flashcontent\" style=\"width: 330px; height: 270px\"></div><script type=\"text/javascript\">var fo = new FlashObject(\"flvPlayer.swf\", \"animationName\", \"330\", \"270\", \"8\", \"#FFFFFF\");fo.addParam(\"allowScriptAccess\", \"sameDomain\");fo.addParam(\"quality\", \"high\");fo.addParam(\"FlashVars\", \"flvPath=$picture_url&flvTitle=$descript\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"flashcontent\");</script>";
To (your dimensions):
Code: [Select]
$pic_html = "<script type=\"text/javascript\" src=\"flashobject.js\"></script><div id=\"flashcontent\" style=\"width: 480px; height: 360px\"></div><script type=\"text/javascript\">var fo = new FlashObject(\"flvPlayer.swf\", \"animationName\", \"480\", \"360\", \"8\", \"#FFFFFF\");fo.addParam(\"allowScriptAccess\", \"sameDomain\");fo.addParam(\"quality\", \"high\");fo.addParam(\"FlashVars\", \"flvPath=$picture_url&flvTitle=$descript\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"flashcontent\");</script>";
Title: Re: Another FLV Player
Post by: haga45 on May 21, 2007, 02:48:59 pm
Thanks!  I got your FLV player working and decided to keep it at your original resolution. 

One thing I've noticed as I work with FLV videos (not related to your plugin) - there appears to be a visual difference between Firefox and IE 6 (or 7) in how FLV videos play back.  On Firefox, my video looks very smooth (sports video), but on IE it is very "jumpy".  I have tried a bunch of different settings in my On2 VP6 plugin, and have used 2 different FLV players now and tested on several different PCs... same results... looks jumpy in IE.

I know this isn't related to Coppermine's capabilities (I love it!), but has anybody noticed this - suggestions on how to deal with it?

Thanks
Title: Re: Another FLV Player
Post by: edoitaly on May 27, 2007, 06:11:04 pm
OK, a questo punto mi sento un defi...    :-[ :-[
dove trovo questo file: flashobject.js
che devo mettere in root?
Title: Re: Another FLV Player
Post by: Joachim Müller on May 28, 2007, 09:57:02 am
You mustn't post in Italian here. Only English replies are allowed. If you only speak Italian, post your issues on the Italian sub-board (http://forum.coppermine-gallery.net/index.php?board=89.0).
Title: Re: Another FLV Player
Post by: edoitaly on May 28, 2007, 06:03:15 pm
Sorry, I must have been completely sold out!!!! :P :P


Here it is my post in English:

OK, now I feel Kind of stupid...    Embarrassed Embarrassed
where can I find this file: flashobject.js
that I must put in coppenmine root?
Title: Re: Another FLV Player
Post by: rphMedia on May 28, 2007, 06:32:36 pm
It's in the original attachment, first post.
Title: Re: Another FLV Player
Post by: jostor on May 29, 2007, 05:47:31 pm
Hi!
I have done exactly what you described, but it won't work. I just get a completely grey field with no content. If I use gwendolyn's player I get something that looks like a player, but nothing happens when I click on play or any other buttons.

This is the part of theme.php that contains the edits I have done:
Code: [Select]
        // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }

        $player = $players[$user_player];

if ($mime_content['extension'] == "flv") {
$descript = $CURRENT_PIC_DATA['title'];
$pic_html = "<script type=\"text/javascript\" src=\"flashobject.js\"></script><div id=\"flashcontent\" style=\"width: 330px; height: 270px\"></div><script type=\"text/javascript\">var fo = new FlashObject(\"flvPlayer.swf\", \"animationName\", \"330\", \"270\", \"8\", \"#FFFFFF\");fo.addParam(\"allowScriptAccess\", \"sameDomain\");fo.addParam(\"quality\", \"high\");fo.addParam(\"FlashVars\", \"flvPath=$picture_url&flvTitle=$descript\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"flashcontent\");</script>";
} else {
        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"src\" value=\"". $picture_url . "\" /><param name=\"ShowControls\" value=\"1\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"ShowStatusBar\" value=\"1\" /><param name=\"ShowDisplay\" value=\"0\" /><param name=\"DisplaySize\" value=\"0\" /><param name=\"autostart\" value=\"$autostart\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" AllowChangeDisplaySize="1" '.' autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }
}

The link to my video in my coppermine gallery is here: http://jostor.com/gallery/displayimage.php?album=1&pos=66 (http://jostor.com/gallery/displayimage.php?album=1&pos=66)

I hope someone can help me, thankyou very much!
Title: Re: Another FLV Player
Post by: rphMedia on May 29, 2007, 06:05:08 pm
You need to put the flvPlayer.swf and flashobject.js (attached in first post) in your gallery root, then try again.
Title: Re: Another FLV Player
Post by: jostor on May 29, 2007, 06:12:51 pm
Thankyou for your reply!
I have already done that, they are in http://jostor.com/gallery

PS. I am using Coppermine 1.4.10, do you know if the player works with this version?
Title: Re: Another FLV Player
Post by: jostor on May 29, 2007, 06:19:25 pm
I'm sorry, I wasn't using the right files. I was using the files from gwendolyn's post. When i replaced them with flvPlayer.swf and flashobject.js from your post everything worked great!

Thankyou very much for helping me! :)
Title: Re: Another FLV Player
Post by: jostor on May 30, 2007, 04:44:40 pm
Is there a way this player can buffer the video before playing it?
Title: Re: Another FLV Player
Post by: rphMedia on May 30, 2007, 04:53:34 pm
Is there a way this player can buffer the video before playing it?
It already does buffer the video before playing it. If you're having problems playing the video then it's either your connection or your server's problem, not the player.
Title: Re: Another FLV Player
Post by: s5iztok on May 31, 2007, 11:48:37 am
any idea how to setup album to get thumbnails instead "video" thumnail for *.vlf files?

http://video.agility-slo.net
Title: Re: Another FLV Player
Post by: rphMedia on May 31, 2007, 12:22:33 pm
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#cust_thmb
Title: Re: Another FLV Player
Post by: MEGALOLZ on June 05, 2007, 06:21:33 pm
is it possible to use this mod, but with a flv player that i have built myself?

if so, what settings do i need to change within flash (flash 8).

thanks
Mike
Title: Re: Another FLV Player
Post by: rphMedia on June 05, 2007, 09:53:56 pm
is it possible to use this mod, but with a flv player that i have built myself?

if so, what settings do i need to change within flash (flash 8).

thanks
Mike
You could do it 2 ways. One is (if you want to use my code out-of-the-box) - make a variable for the path to accept flvPath as the url of the FLV.  Or you could create your own Flash Var(s).
Title: Re: Another FLV Player
Post by: MEGALOLZ on June 05, 2007, 09:57:26 pm
would you be able to walk me through it?

ive had experience with flash before, but nothing too advanced.

I'm more of a designer than a coder ;) lol
Title: Re: Another FLV Player
Post by: rphMedia on June 05, 2007, 10:29:18 pm
No, sorry. From your question, you sounded like you were ready for the answer.

It would take a lot of "walk me thru it" time to guide you and this is not the place.  Try flashkit.com, lots of help there. Though not really difficult, it is time consuming to explain/learn.

Title: Re: Another FLV Player
Post by: MEGALOLZ on June 05, 2007, 10:32:56 pm
ok cheers anyway, but i've tried flashkit before, and could never find any tutorials on how to change variables in the component inspector via an external script..
guess i'll go look again =\

Mike

p.s. i already have an fla, and its playing videos i set directly, its just changing it dynamically that i can't get working
Title: Re: Another FLV Player
Post by: jack5288 on June 11, 2007, 12:33:42 am
hi i have a "big" problem

Parse error: syntax error, unexpected $end in /www/htdocs/w0087014/coppermine/themes/water_drop/theme.php on line 184

theme.php:
Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.10
  $Source$
  $Revision: 3275 $
  $Author: gaugau $
  $Date: 2006-09-03 12:10:47 +0200 (So, 03 Sep 2006) $
**********************************************/

define('THEME_IS_XHTML10_TRANSITIONAL',1); // Remove this if you edit this template until
                                           // you have validated it. See docs/theme.htm.

// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='<img src="themes/water_drop/images/orange_carret.gif" width="8" height="8" border="0" alt="" />';
// Displays a picture
function theme_html_picture()
{
    global 
$CONFIG$CURRENT_PIC_DATA$CURRENT_ALBUM_DATA$USER;
    global 
$album$comment_date_fmt$template_display_media;
    global 
$lang_display_image_php$lang_picinfo;

    
$pid $CURRENT_PIC_DATA['pid'];
    
$pic_title '';

    if (!isset(
$USER['liv']) || !is_array($USER['liv'])) {
        
$USER['liv'] = array();
    }
    
// Add 1 to hit counter
    
if (!USER_IS_ADMIN && !in_array($pid$USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        
add_hit($pid);
        if (
count($USER['liv']) > 4array_shift($USER['liv']);
        
array_push($USER['liv'], $pid);
    }

    if(
$CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      
$condition true;
    }elseif(
$CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      
$condition true;
    }elseif(
$CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      
$condition true;
    }else{
     
$condition false;
    }

    if (
$CURRENT_PIC_DATA['title'] != '') {
        
$pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if (
$CURRENT_PIC_DATA['caption'] != '') {
        
$pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if (
$CURRENT_PIC_DATA['keywords'] != '') {
        
$pic_title .= $lang_picinfo['Keywords'] . ": " $CURRENT_PIC_DATA['keywords'];
    }

    if (!
$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        
template_extract_block($template_display_media'img_desc');
    } else {
        if (!
$CURRENT_PIC_DATA['title']) {
            
template_extract_block($template_display_media'title');
        }
        if (!
$CURRENT_PIC_DATA['caption']) {
            
template_extract_block($template_display_media'caption');
        }
    }

    
$CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    
if ($CONFIG['make_intermediate'] && $condition ) {
        
$picture_url get_pic_url($CURRENT_PIC_DATA'normal');
    } else {
        
$picture_url get_pic_url($CURRENT_PIC_DATA'fullsize');
    }

    
$image_size compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    
$pic_title '';
    
$mime_content cpg_get_type($CURRENT_PIC_DATA['filename']);


    if (
$mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if (
$CURRENT_PIC_DATA['pwidth']==|| $CURRENT_PIC_DATA['pheight']==0) {
            
$CURRENT_PIC_DATA['pwidth']  = 320// Default width

            // Set default height; if file is a movie
            
if ($mime_content['content']=='movie') {
                
$CURRENT_PIC_DATA['pheight'] = 240// Default height
            
}
        }

        
$ctrl_offset['mov']=15;
        
$ctrl_offset['wmv']=45;
        
$ctrl_offset['swf']=0;
        
$ctrl_offset['rm']=0;
        
$ctrl_offset_default=45;
        
$ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        
$image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if (
$mime_content['content']=='image') {
        if (isset(
$image_size['reduced'])) {
            
$winsizeX $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            
$winsizeY $CURRENT_PIC_DATA['pheight']+3//the +'s are the mysterious FF and IE paddings
            
$pic_html "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            
$pic_title $lang_display_image_php['view_fs'] . "\n==============\n" $pic_title;
            
$pic_html .= "<img src=\"" $picture_url "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            
$pic_html .= "</a>\n";
        } else {
            
$pic_html "<img src=\"" $picture_url "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }
    } elseif (
$mime_content['content']=='document') {
        
$pic_thumb_url get_pic_url($CURRENT_PIC_DATA,'thumb');
        
$pic_html "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        
$autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        
$players['WMP'] = array('id' => 'MediaPlayer',
                                
'clsid' => 'classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ',
                                
'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                
'mime' => 'type="application/x-mplayer2" ',
                               );
        
$players['RMP'] = array('id' => 'RealPlayer',
                                
'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                
'codebase' => '',
                                
'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               
);
        
$players['QT']  = array('id' => 'QuickTime',
                                
'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                
'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                
'mime' => 'type="video/x-quicktime" '
                               
);
        
$players['SWF'] = array('id' => 'SWFlash',
                                
'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                
'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                
'mime' => 'type="application/x-shockwave-flash" '
                               
);
        
$players['UNK'] = array('id' => 'DefaultPlayer',
                                
'clsid' => '',
                                
'codebase' => '',
                                
'mime' => ''
                               
);

        if (isset(
$_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            
$user_player $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            
$user_player $mime_content['player'];
        }

                
// There isn't a player selected or user wants client-side control
        
if (!$user_player) {
            
$user_player 'UNK';
        }

        if (
$mime_content['content']=='movie' && $mime_content['extension']=='flv') {
    $flv =  $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];
    $pic_html  "<object type=\"application/x-shockwave-flash\" width=\"320\" height=\"260\" wmode=\"transparent\" data=\"flvplayer.swf?file=$flv?autoStart=false\">";
    $pic_html .= "<param name=\"movie\" value=\"flvplayer.swf?file=$flv?autoStart=false\" />";
    $pic_html .= "<param name=\"wmode\" value=\"transparent\" />";
            
$pic_html .= "</object><br />\n";

        } else {

$player $players[$user_player];

if (
$mime_content['extension'] == "flv") {
$descript $CURRENT_PIC_DATA['title'];
$pic_html "<script type=\"text/javascript\" src=\"flashobject.js\"></script><div id=\"flashcontent\" style=\"width: 320px; height: 240px\"></div><script type=\"text/javascript\">var fo = new FlashObject(\"flvPlayer.swf\", \"animationName\", \"330\", \"270\", \"8\", \"#FFFFFF\");fo.addParam(\"allowScriptAccess\", \"sameDomain\");fo.addParam(\"quality\", \"high\");fo.addParam(\"FlashVars\", \"flvPath=$picture_url&flvTitle=$descript\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"flashcontent\");</script>";
} else {
        
$pic_html  '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        
$pic_html .= "<param name=\"src\" value=\""$picture_url "\" /><param name=\"ShowControls\" value=\"1\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"ShowStatusBar\" value=\"1\" /><param name=\"ShowDisplay\" value=\"0\" /><param name=\"DisplaySize\" value=\"0\" /><param name=\"autostart\" value=\"$autostart\" />";
        
$pic_html .= '<embed '.$image_size['whole'].' src="'$picture_url '" AllowChangeDisplaySize="1" '.' autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        
$pic_html .= "</object><br />\n";
}
?>
Title: Re: Another FLV Player
Post by: Nibbler on June 11, 2007, 01:27:20 am
You've copied half the function. Copy the whole thing.
Title: Re: Another FLV Player
Post by: tim18 on July 20, 2007, 11:40:48 am
Hi,

I have opened up the theme.php file and found that its really a blank canvas.
Code: [Select]
define('THEME_HAS_RATING_GRAPHICS', 1);
define('THEME_HAS_NAVBAR_GRAPHICS', 1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);  // Remove this if you edit this template until
                                            // you have validated it. See docs/theme.htm.

// HTML template for main menu
$template_sys_menu = <<<EOT
                <div class="topmenu">
                     {BUTTONS}
                </div>
EOT;

// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='';


?>

In your opening post you mentioned something about making sure the function theme_html_picture() exists. By the look of it, i dont think it does. Am i missing something?
Thanks
Tim
Title: Re: Another FLV Player
Post by: Nibbler on July 20, 2007, 12:05:41 pm
Copy the function from the sample theme.
Title: Re: Another FLV Player
Post by: ba2 on July 23, 2007, 11:36:51 pm
Hello to all!
I have some problems to install the flv player.
I have a blank theme.php (well there is just some codes)
what do I need to add between the lines :

define('THEME_IS_XHTML10_TRANSITIONAL',1);

?>

thanks
Title: Re: Another FLV Player
Post by: Joachim Müller on July 25, 2007, 08:29:26 am
Do as Nibbler suggested just one posting above yours. In the future, read the thread you reply to thoroughly before starting your reply.
Title: Re: Another FLV Player
Post by: mrdummy on August 06, 2007, 02:25:23 pm
I tried this with 1.4.12

I copied whole function from theme.inc.php inside theme.php
Paste the code for FLV part inside function.
Copied ... ho! The JW Player package has newer swfobject.js (v1.5) and the flashobject.js seems older (v1.2.3).
Both are placed in gallery root.
FLV file type added.

When i run the gallery with modifications, i can add FLV files, but when i want play one, the screen is black.
This is tested in Firefox 2.0.0.6.
With IE 6, the player itself shows indeed up with 'Play' icon. But no clip is visible or playable.

When i check sample html file of JW Player, the settings are different.
Title: Re: Another FLV Player
Post by: mrdummy on August 06, 2007, 02:50:46 pm
Finally found the problem.
The JW Player is indeed internally changed, thus you need new setting values to play FLV files possible.

This code
Code: [Select]
fo.addParam(\"FlashVars\", \"flvPath=$picture_url&flvTitle=$descript\");

change in
Code: [Select]
fo.addVariable(\"file\",\"$picture_url\");
And you can play finally FLV files. Verified in Firefox and IE 6+
It's important to compare changes with sample HTML inside JW Player zip file. I add new codes from sample HTML file and that is the answer.
The old code in startpost doesn't work with latest zip package.
You may add more codes from sample HTML file inside $pic_html if you want, for example custom colors.
Title: Re: Another FLV Player
Post by: ULISS on September 13, 2007, 11:10:24 am
Why the mod is doesh,t worked? What hapend? Sorry for my bad Russian-English.... :P

http://www.usiba.ru/gallery/displayimage-random-10--187.html (http://www.usiba.ru/gallery/displayimage-random-10--187.html)
Title: Re: Another FLV Player
Post by: angel777 on September 21, 2007, 03:25:17 am
How to Editing Theme.php in Coppermine 1.4.13 - Security release?

In this release there isn't
Code: [Select]
// There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = etc etc


Where mod?
 ... at the End I crashed all themes i created i think..lol
Title: Re: Another FLV Player
Post by: Joachim Müller on September 21, 2007, 07:21:08 am
As suggested in the initial announcement for this mod
Modify theme.php (ensure the function theme_html_picture() exists).
you have to make sure that the function that needs modification actually exists in your custom theme. If it doesn't copy
Code: [Select]
// Displays a picture
function theme_html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
    global $album, $comment_date_fmt, $template_display_media;
    global $lang_display_image_php, $lang_picinfo;

    $pid = $CURRENT_PIC_DATA['pid'];
    $pic_title = '';

    if (!isset($USER['liv']) || !is_array($USER['liv'])) {
        $USER['liv'] = array();
    }
    // Add 1 to hit counter
    if (!USER_IS_ADMIN && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }

    if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      $condition = true;
    }else{
     $condition = false;
    }

    if ($CURRENT_PIC_DATA['title'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if ($CURRENT_PIC_DATA['caption'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if ($CURRENT_PIC_DATA['keywords'] != '') {
        $pic_title .= $lang_picinfo['Keywords'] . ": " . $CURRENT_PIC_DATA['keywords'];
    }

    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }

    $CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    if ($CONFIG['make_intermediate'] && $condition ) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }

    $image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    $pic_title = '';
    $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);


    if ($mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) {
            $CURRENT_PIC_DATA['pwidth']  = 320; // Default width

            // Set default height; if file is a movie
            if ($mime_content['content']=='movie') {
                $CURRENT_PIC_DATA['pheight'] = 240; // Default height
            }
        }

        $ctrl_offset['mov']=15;
        $ctrl_offset['wmv']=45;
        $ctrl_offset['swf']=0;
        $ctrl_offset['rm']=0;
        $ctrl_offset_default=45;
        $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        $image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }
    } elseif ($mime_content['content']=='document') {
        $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        $autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        $players['WMP'] = array('id' => 'MediaPlayer',
                                'clsid' => 'classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ',
                                'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                'mime' => 'type="application/x-mplayer2" ',
                               );
        $players['RMP'] = array('id' => 'RealPlayer',
                                'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                'codebase' => '',
                                'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               );
        $players['QT']  = array('id' => 'QuickTime',
                                'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                'mime' => 'type="video/x-quicktime" '
                               );
        $players['SWF'] = array('id' => 'SWFlash',
                                'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                'mime' => 'type="application/x-shockwave-flash" '
                               );
        $players['UNK'] = array('id' => 'DefaultPlayer',
                                'clsid' => '',
                                'codebase' => '',
                                'mime' => ''
                               );

        if (isset($_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            $user_player = $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            $user_player = $mime_content['player'];
        }

                // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }

        $player = $players[$user_player];

        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }

    $CURRENT_PIC_DATA['html'] = $pic_html;
    $CURRENT_PIC_DATA['header'] = '';
    $CURRENT_PIC_DATA['footer'] = '';

    $CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    $params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return template_eval($template_display_media, $params);
}
from themes/sample/theme.php into a new line before
Code: [Select]
?>of the file themes/yourtheme/theme.php. Not related to the maintenance release at all. This has been the same way for all versions ever. For details, take a look at the documentation that comes with coppermine - the section http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#theme_sample comes to mind.
Title: Re: Another FLV Player
Post by: angel777 on September 21, 2007, 10:12:20 pm
Thanks i finally resolve but now is disappear possible to comments, i don't know why :S :(
Title: Re: Another FLV Player
Post by: ksawery on September 23, 2007, 10:08:07 pm
I've read and followed carefully all the steps, but it doesn't work. I can see the FLV player, but it shows: "Media not found". :P

Any idea?
Title: Re: Another FLV Player
Post by: rphMedia on September 24, 2007, 08:33:05 am
I've read and followed carefully all the steps, but it doesn't work. I can see the FLV player, but it shows: "Media not found". :P

Any idea?
Link?
Title: Re: Another FLV Player
Post by: ksawery on September 24, 2007, 01:53:37 pm
Solved! It was a failure in the uploading of the file (video) to server.

Thanks anyway!
Title: Re: Another FLV Player
Post by: Cino on September 27, 2007, 06:05:40 pm
Link?

I'm having the same problem. I don't upload files to my site, i move them right into the folders.. This is running a windows 2003 iis server. Here is a link

http://photo.cino.homeip.net/displayimage.php?album=108&pos=7
Title: Re: Another FLV Player
Post by: rphMedia on September 27, 2007, 07:25:38 pm
... i move them right into the folders...

What does that mean??

According to your source, the flv should be here - http://photo.cino.homeip.net/albums/test/test.flv but it's not.
Title: Re: Another FLV Player
Post by: Cino on September 27, 2007, 08:36:38 pm
What does that mean??

According to your source, the flv should be here - http://photo.cino.homeip.net/albums/test/test.flv but it's not.

I copy the files into the folders, copy and paste... then use batch add files to import them into cpg... The file is there, here is a screenshot of the folder http://photo.cino.homeip.net/displayimage.php?album=108&pos=8
Title: Re: Another FLV Player
Post by: rphMedia on September 27, 2007, 08:48:19 pm
It seems that you're having connection problems (not related).

Anyway, I can't see the screenshot (must be a non-guest at your gallery).

Put the test.flv file in your root and post a link so I can actually look at the flv.
Title: Re: Another FLV Player
Post by: Cino on September 27, 2007, 09:02:11 pm
I was able to fix it... I totally forgot to add .flv to the IIS MIME types... I did within CPG but not IIS... its working now... Thanks again for the quick replys
Title: Re: Another FLV Player
Post by: realnet1 on February 02, 2008, 09:52:29 pm
Can you check and see what I might have mised, player loads but still get a blank screen
ps might be adult rated
http://www.adultphotopost.us/Gallery/displayimage.php?album=3&pos=1
Title: Re: Another FLV Player
Post by: rphMedia on February 03, 2008, 01:42:34 pm
Can you check and see what I might have mised, player loads but still get a blank screen
ps might be adult rated
http://www.adultphotopost.us/Gallery/displayimage.php?album=3&pos=1
You're in the wrong thread. Not this mod.
Title: Re: Another FLV Player
Post by: Halfhidden on February 04, 2008, 05:15:41 pm
I've installed this excellent mod and it works perfectly    ;D However. I need to change the theme from Classic to Classic Nifty. When I open the theme.php I cannot find the the following code:

$player = $players[$user_player];

        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }

Can anyone guide me on this please?

Regards,
Steff
Title: Re: Another FLV Player
Post by: Halfhidden on February 04, 2008, 05:42:30 pm
Sorry... I did read the replys but somehow didn't see Reply #40 on: September 21, 2007, 07:21:08 AM that expalins what I have just asked.....


Sorry to be a pain. This is resolved.
Regards,
Steff
Title: Re: Another FLV Player
Post by: realnet1 on February 07, 2008, 07:43:37 pm
includes/functions.inc.php     does anyone have a copy of this file so I can see how/what to modify for flv to work correctly

Thank you
Title: Re: Another FLV Player
Post by: ahbut on February 16, 2008, 05:31:26 pm
Hi, I followed al the instruction of putting the flash player and .js file in the root dir, and also I had include the theme.php file below, pretty much exactly as post#40. But all I get is a white screen, pplease help me to resolve this issue, been trying for awhile before I had to post to get help, hope its not a stupid mistake.
  Also, am I suppose to modify the theme.inc.php file at all?? or just the theme.php only

Web site link : http://www.i088.com/kids/displayimage.php?album=23&pos=3

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2008 Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.
  
  ********************************************
  Coppermine version: 1.4.16
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/themes/fruity/theme.php $
  $Revision: 4233 $
  $Author: gaugau $
  $Date: 2008-02-02 09:23:58 +0100 (Sa, 02 Feb 2008) $
**********************************************/

// ------------------------------------------------------------------------- //
// The theme "Fruity" has been done by GauGau (http://gaugau.de/) based on   //
// the framed template of studicasa.nl (their website has gone down, so I    //
// guess no one will care). The usage of this theme is free for personal     //
// use, not for commercial use (according to the disclaimer of studiocasa)!  //
// ------------------------------------------------------------------------- //

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_HAS_NAVBAR_GRAPHICS'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);  // Remove this if you edit this template until
                                            // you have validated it. See docs/theme.htm.

// HTML template for main menu
$template_sys_menu = <<<EOT
                <div class="topmenu">
                     {BUTTONS}
                </div>
EOT;

// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='';

// Displays a picture
function theme_html_picture()
{
    global 
$CONFIG$CURRENT_PIC_DATA$CURRENT_ALBUM_DATA$USER;
    global 
$album$comment_date_fmt$template_display_media;
    global 
$lang_display_image_php$lang_picinfo;

    
$pid $CURRENT_PIC_DATA['pid'];
    
$pic_title '';

    if (!isset(
$USER['liv']) || !is_array($USER['liv'])) {
        
$USER['liv'] = array();
    }
    
// Add 1 to hit counter
    
if (!USER_IS_ADMIN && !in_array($pid$USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        
add_hit($pid);
        if (
count($USER['liv']) > 4array_shift($USER['liv']);
        
array_push($USER['liv'], $pid);
    }

    if(
$CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      
$condition true;
    }elseif(
$CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      
$condition true;
    }elseif(
$CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      
$condition true;
    }else{
     
$condition false;
    }

    if (
$CURRENT_PIC_DATA['title'] != '') {
        
$pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if (
$CURRENT_PIC_DATA['caption'] != '') {
        
$pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if (
$CURRENT_PIC_DATA['keywords'] != '') {
        
$pic_title .= $lang_picinfo['Keywords'] . ": " $CURRENT_PIC_DATA['keywords'];
    }

    if (!
$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        
template_extract_block($template_display_media'img_desc');
    } else {
        if (!
$CURRENT_PIC_DATA['title']) {
            
template_extract_block($template_display_media'title');
        }
        if (!
$CURRENT_PIC_DATA['caption']) {
            
template_extract_block($template_display_media'caption');
        }
    }

    
$CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    
if ($CONFIG['make_intermediate'] && $condition ) {
        
$picture_url get_pic_url($CURRENT_PIC_DATA'normal');
    } else {
        
$picture_url get_pic_url($CURRENT_PIC_DATA'fullsize');
    }

    
$image_size compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    
$pic_title '';
    
$mime_content cpg_get_type($CURRENT_PIC_DATA['filename']);


    if (
$mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if (
$CURRENT_PIC_DATA['pwidth']==|| $CURRENT_PIC_DATA['pheight']==0) {
            
$CURRENT_PIC_DATA['pwidth']  = 320// Default width

            // Set default height; if file is a movie
            
if ($mime_content['content']=='movie') {
                
$CURRENT_PIC_DATA['pheight'] = 240// Default height
            
}
        }

        
$ctrl_offset['mov']=15;
        
$ctrl_offset['wmv']=45;
        
$ctrl_offset['swf']=0;
        
$ctrl_offset['rm']=0;
        
$ctrl_offset_default=45;
        
$ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        
$image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if (
$mime_content['content']=='image') {
        if (isset(
$image_size['reduced'])) {
            
$winsizeX $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            
$winsizeY $CURRENT_PIC_DATA['pheight']+3//the +'s are the mysterious FF and IE paddings
            
$pic_html "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            
$pic_title $lang_display_image_php['view_fs'] . "\n==============\n" $pic_title;
            
$pic_html .= "<img src=\"" $picture_url "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            
$pic_html .= "</a>\n";
        } else {
            
$pic_html "<img src=\"" $picture_url "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }
    } elseif (
$mime_content['content']=='document') {
        
$pic_thumb_url get_pic_url($CURRENT_PIC_DATA,'thumb');
        
$pic_html "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        
$autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        
$players['WMP'] = array('id' => 'MediaPlayer',
                                
'clsid' => 'classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ',
                                
'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                
'mime' => 'type="application/x-mplayer2" ',
                               );
        
$players['RMP'] = array('id' => 'RealPlayer',
                                
'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                
'codebase' => '',
                                
'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               
);
        
$players['QT']  = array('id' => 'QuickTime',
                                
'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                
'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                
'mime' => 'type="video/x-quicktime" '
                               
);
        
$players['SWF'] = array('id' => 'SWFlash',
                                
'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                
'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                
'mime' => 'type="application/x-shockwave-flash" '
                               
);
        
$players['UNK'] = array('id' => 'DefaultPlayer',
                                
'clsid' => '',
                                
'codebase' => '',
                                
'mime' => ''
                               
);

        if (isset(
$_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            
$user_player $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            
$user_player $mime_content['player'];
        }

                
// There isn't a player selected or user wants client-side control
        
if (!$user_player) {
            
$user_player 'UNK';
        }

$player $players[$user_player];

if (
$mime_content['extension'] == "flv") {
$descript $CURRENT_PIC_DATA['title'];
$pic_html "<script type=\"text/javascript\" src=\"flashobject.js\"></script><div id=\"flashcontent\" style=\"width: 330px; height: 270px\"></div><script type=\"text/javascript\">var fo = new FlashObject(\"flvPlayer.swf\", \"animationName\", \"330\", \"270\", \"8\", \"#FFFFFF\");fo.addParam(\"allowScriptAccess\", \"sameDomain\");fo.addParam(\"quality\", \"high\");fo.addParam(\"FlashVars\", \"flvPath=$picture_url&flvTitle=$descript\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"flashcontent\");</script>";
} else {
        
$pic_html  '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        
$pic_html .= "<param name=\"src\" value=\""$picture_url "\" /><param name=\"ShowControls\" value=\"1\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"ShowStatusBar\" value=\"1\" /><param name=\"ShowDisplay\" value=\"0\" /><param name=\"DisplaySize\" value=\"0\" /><param name=\"autostart\" value=\"$autostart\" />";
        
$pic_html .= '<embed '.$image_size['whole'].' src="'$picture_url '" AllowChangeDisplaySize="1" '.' autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        
$pic_html .= "</object><br />\n";
    }
}

    
$CURRENT_PIC_DATA['html'] = $pic_html;
    
$CURRENT_PIC_DATA['header'] = '';
    
$CURRENT_PIC_DATA['footer'] = '';

    
$CURRENT_PIC_DATA CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    
$params = array('{CELL_HEIGHT}' => '100',
        
'{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        
'{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        
'{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        
'{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return 
template_eval($template_display_media$params);
}
?>

Thank you so much
Title: Re: Another FLV Player
Post by: rphMedia on February 17, 2008, 10:12:50 pm
Did you install the filetype plug-in? http://forum.coppermine-gallery.net/index.php?topic=24186.msg111120

Follow the instructions exactly in the first post.
Title: Re: Another FLV Player
Post by: ahbut on February 18, 2008, 05:21:40 pm
yes I did, that was the first step

 I followed everysingle step already
Title: Re: Another FLV Player
Post by: ahbut on February 18, 2008, 05:29:24 pm
I had also tried installing the other flv mod, all  I get was screen loading, then after I do get the black screen, and timeline bar, just can't play the movie files as well , any idea what else might be wrong?? Sorry, I really wat this mod to work for me

Any help will be greatly appreciated.
Title: Re: Another FLV Player
Post by: ahbut on February 18, 2008, 06:48:08 pm
Hmm, not sure what happened, on the server , I found out no matter how many times I upload the theme.php file, it didn't show the updates. It remains as the the original empty theme.php file, I had download another FTP program and got it uploaded.

And everything works now ... So sorry to post so many times, and takes up all these spaces
Title: Re: Another FLV Player
Post by: Minty on February 19, 2008, 02:46:28 am
I've browsed through this thread but cant find that anyone has encountered what Im getting. After making the mod, copy/paste the code from the sample theme.php into the theme theme.php I want to use, then replace the code as outlined, I can watch the flv files but none of the other file types work. Previous to the mod obviously the other media types functioned.

Any thoughts on where I screwed up?
Title: Re: Another FLV Player
Post by: DaBe on March 21, 2008, 10:31:51 pm
hello

is there possible to play with the flash player also mp3 files. because the windows player sucks, and real and apple player dont have everybody.

or is there another mod?

I have searched "flash mp3" but not good infos.
Title: Re: Another FLV Player
Post by: Joachim Müller on March 22, 2008, 02:17:01 am
is there possible to play with the flash player also mp3 files.
No. It's a flash player, not an MP3 player. Don't clutter an announcement thread for an embedded flash player with your requests for something totally unrelated.
Title: Re: Another FLV Player
Post by: Carlos5039 on April 13, 2008, 07:03:16 pm
Can this be modified to use other players?  I have purchased "Sothink Video Encoder" and it offers a FLV movie player ".swf", and I would like to see if I can use it.

Thanks
Title: Re: Another FLV Player
Post by: Zam on May 28, 2008, 06:35:48 pm
thanks for this - I love it :D
Title: Re: Another FLV Player
Post by: PagaNation on July 17, 2008, 10:03:33 pm
Hi! First post here, but have been lurking in the shadows around the forums for a bit as I get coppermine working in my site :) Hope this thread gets some looks still, wasn't sure if I should post in a new thread, but I am using this hack, sooo...

Wondering if anyone can help me get another player to work with this? I have searched high and low for a player that does all that I need/want, and most of the very nice ones are using javascript... I can't for the life of me figure out how to get these to work with coppermine. As standalone, they are no problem.... but trying to get the filename string (in this hack $flv) paased from coppermine into the player is causing me to pull my hair a bit.

One player I found which has lots of nice features is this one: http://flvhosting.com/clients/looplayer/ (http://flvhosting.com/clients/looplayer/) ... how to get it to work, though??? Another very nice one, is OS FLV, found here: http://www.osflv.com/ (http://www.osflv.com/) ... several more, I have attempted, but no good... :( My knowledge of javascript is basically none and even very lacking with PHP (but am slowly learning as I go along... more trial and error ATM)...

Even the JW player would be fine, except for two problems: 1) the fullscreen button doesn't appear for me (I don't really like the click to fullscreen.. rather this pause and play). 2) It has had troubles playing some media, playing audio, but no video. Now, this could just be something that went odd when I did the FLV conversion, but then, some other players have no issue with this media... but, again, can't get these players to work with coppermine.

I would like to get this working ASAP, since when I get my mind on one specific part of the site work, it's difficult for me to focus on anything else ;)

Many thanks in advance and more to follow for any help!!!
Title: Re: Another FLV Player
Post by: PagaNation on July 20, 2008, 08:25:39 am
No thoughts on this? How about just ANY player that integrates well with coppermine and has a fullscreen button? Is that tumbleweed I see bouncing through here? Anybody?
Title: Re: Another FLV Player
Post by: rphMedia on July 20, 2008, 01:22:03 pm
Probably the wrong thread to be asking for other players.
Title: Re: Another FLV Player
Post by: PagaNation on July 20, 2008, 11:30:48 pm
Probably the wrong thread to be asking for other players.

Well, see I lost Karma on that one... impatience led to agitation and then to a slight bit of rudeness... sorry about that. Guess I will post in another thread on this then...
Title: Re: Another FLV Player
Post by: papilow on July 27, 2008, 03:13:55 am
It already does buffer the video before playing it. If you're having problems playing the video then it's either your connection or your server's problem, not the player.

I could also use this feature.  I need it to buffer 5 seconds of the video.  The File encoding is rather large for the videos i am using.  What is happening is the file does not download to my pc fast enough and it freezes and buffers again.  is there any way to modify this setting?
Title: Re: Another FLV Player
Post by: rphMedia on July 27, 2008, 02:35:52 pm
Try the attached - increased the buffer time.
Also added Full Screen capability (right-click).
Title: Re: Another FLV Player
Post by: papilow on July 27, 2008, 09:22:53 pm
thanks!  what did you change the buffer too? now the videos dont auto play.  Not really a big deal, just curious.   Id rather have the buffer then the auto play.
Title: Re: Another FLV Player
Post by: rphMedia on July 27, 2008, 11:15:36 pm
I'll fix that tomorrow, out of town.
Title: Re: Another FLV Player
Post by: papilow on July 28, 2008, 05:33:20 am
as far as im concerned it works fine for me :-)  thx for your hardwork.
Title: Re: Another FLV Player
Post by: only_dig on August 09, 2008, 12:06:35 pm
Don't play files with cyrillic names.
Title: Re: Another FLV Player
Post by: mariahxxx on August 12, 2008, 04:55:25 pm
I have followed every instruction but when I go to add the flv files there is no "OK" to selct the files to add them!!

to be more specific so I dont get blasted for being too vague,

I created my album, clicked "Batch Add Files" and selcted my directory where I uploaded the FLV files and the flv video shows but there is no "OK" to select that file directory to begin to add the file(s)!!!!

is it not recognizing the file type still? I added a jpg to see if it saw this and it did, so it is still not seeing my flv file type :(

any help at all?

thanks!
xoxo
Mariah
Title: Re: Another FLV Player
Post by: rphMedia on August 13, 2008, 12:50:29 pm
I don't think your problem is related to this mod.
Title: Re: Another FLV Player
Post by: Αndré on August 13, 2008, 01:43:19 pm
I have followed every instruction but when I go to add the flv files there is no "OK" to selct the files to add them!!

to be more specific so I dont get blasted for being too vague,

I created my album, clicked "Batch Add Files" and selcted my directory where I uploaded the FLV files and the flv video shows but there is no "OK" to select that file directory to begin to add the file(s)!!!!

is it not recognizing the file type still? I added a jpg to see if it saw this and it did, so it is still not seeing my flv file type :(

any help at all?

thanks!
xoxo
Mariah

mariahxxx has forgot to add the flv file type to the database ;) If a directory has only files of unknown file types, no "OK" button appears in the file browser.
The mod is now working on her homepage.
Title: Re: Another FLV Player
Post by: rphMedia on August 13, 2008, 01:45:47 pm
I was going to ask that, but...

I have followed every instruction...

...convinced me not to.
Title: Re: Another FLV Player
Post by: naved on August 13, 2008, 09:35:03 pm
Sorry, I must have been completely sold out!!!! :P :P


Here it is my post in English:

OK, now I feel Kind of stupid...    Embarrassed Embarrassed
where can I find this file: flashobject.js
that I must put in coppenmine root?


I had the same problem... was wondering where the file is?!!

Then I realised that only registered users can see the attachment. So register and log in with your username and password to THIS board... and al will be revealed.

Hope it helps other clueless wanderers like me ;-)
Title: Re: Another FLV Player
Post by: angel777 on September 19, 2008, 03:14:44 pm
Try the attached - increased the buffer time.
Also added Full Screen capability (right-click).
Thanks, how to set autostart=yes this new?
Title: Re: Another FLV Player
Post by: rphMedia on September 19, 2008, 03:26:40 pm
Thanks, how to set autostart=yes this new?

Autostart IS set to yes  ???

For info, I modified the code in the first post to allow changing the size of the movie. Also fullscreen capability (right-click).
Title: Re: Another FLV Player
Post by: Αndré on September 19, 2008, 05:17:56 pm
For info, I modified the code in the first post to allow changing the size of the movie. Also fullscreen capability (right-click).
Is it normal when you set a value like 640*480 the player (the buttons and the bar at the bottom) will be bigger, too?
I also can't find the fullscreen capability :-\ just "zoom in" and "zoom out", or is this what you mean with fullscreen? ;)
Title: Re: Another FLV Player
Post by: rphMedia on September 19, 2008, 05:33:40 pm
Yes, the buttons do enlarge proportionately. I can make it so the controls auto-hide.

If you add the modified code, right-click the video and you'll see the option to go fullscreen.
Title: Re: Another FLV Player
Post by: Αndré on September 19, 2008, 05:44:53 pm
I tested in your gallery and there it works, but not on my website :(
I've updated the code and also flashobjects.js and flvplayer.swf
Maybe it doesn't work together with one of my plugins? Should I send you a link to a video in my gallery?
Title: Re: Another FLV Player
Post by: rphMedia on September 19, 2008, 05:48:21 pm
Replace the Player with the attached.
Title: Re: Another FLV Player
Post by: Αndré on September 19, 2008, 05:52:11 pm
Works. Thanks :)
Title: Re: Another FLV Player
Post by: alm0stperfect on September 30, 2008, 12:21:04 am
Thank you so much for this! I've been looking for this to provide watching of videos online, instead of having visitors to download them! ;)
Title: Re: Another FLV Player
Post by: Timos-Welt on December 01, 2008, 02:03:36 am
Hi rphMedia,

I'd like to bundle your FLV player with EnlargeIt! (http://forum.coppermine-gallery.net/index.php/topic,53290.0.html) (which is GPL 3.0) - am I allowed to do so, and which license is your great player?

regards
Timo
Title: Re: Another FLV Player
Post by: rphMedia on December 01, 2008, 12:05:27 pm
Hi rphMedia,

I'd like to bundle your FLV player with EnlargeIt! (http://forum.coppermine-gallery.net/index.php/topic,53290.0.html) (which is GPL 3.0) - am I allowed to do so, and which license is your great player?

regards
Timo
I have no problem with that. And I don't have a license attached per-se, so you can bundle it (GPL 3) along with the widget. Maybe just link to this thread for reference.
Title: Re: Another FLV Player
Post by: Timos-Welt on December 01, 2008, 09:23:05 pm
Thank you very much! :)

EnlargeIt! latest beta now supports playback of FLV files with two different players (rphMedia or OS FLV); both are included and can be switched on the plugin config page. File type is automatically added when installing the plugin.

Download (http://forum.coppermine-gallery.net/index.php/topic,53290.msg277877.html#msg277877)

Demo (http://cpgdev.timos-welt.de/cpg1416/thumbnails.php?album=8&theme=water_drop)
Title: Re: Another FLV Player
Post by: Αndré on December 03, 2008, 08:24:55 am
A user in the german support board (http://forum.coppermine-gallery.net/index.php/topic,56908.0.html) reported, that videos with ratio of 16:9 will be deformed and displayed as 4:3. I haven't tested this by myself. Is your player able to play 16:9 videos in its original ratio?
Title: Re: Another FLV Player
Post by: rphMedia on December 03, 2008, 12:18:27 pm
A user in the german support board (http://forum.coppermine-gallery.net/index.php/topic,56908.0.html) reported, that videos with ratio of 16:9 will be deformed and displayed as 4:3. I haven't tested this by myself. Is your player able to play 16:9 videos in its original ratio?
The original does not, but I've attached a version that does maintain aspect ratio.
Title: Re: Another FLV Player
Post by: Αndré on December 03, 2008, 05:54:16 pm
It works quite good, but the border doesn't scale to the video size (I have a upright video where you can see it very good - here (http://photoalbum.ph.funpic.de/cpg/displayimage.php?pos=-70813)). How can I fix it?
Title: Re: Another FLV Player
Post by: rphMedia on December 04, 2008, 12:20:56 pm
The only thing I could do is remove the border, but the video wouldn't be centered.

Why do you have such odd video resolutions anyway? They're far from standard as most web-based videos are either 4:3 or 16:9 ratio.
Title: Re: Another FLV Player
Post by: Αndré on December 04, 2008, 12:40:04 pm
Sometimes people films while holding their camera upright ;) I can't prevent this, that's why I have a few videos with this resolution ::)
Title: Re: Another FLV Player
Post by: Αndré on December 04, 2008, 06:23:02 pm
Back to the 16:9 issue. Maybe you have an idea.

It's hard to explain, so please have a look at this example (http://photoalbum.ph.funpic.de/cpg/displayimage.php?pos=-83889):
- The border loads in the correct size (640*360)
- Then the player loads in 4:3 ratio and fits its height to the video height (in this example 480*360)
- Then the player resizes to 16:9 ratio, but in the wrong size. It takes the current width of the player and fits its height to it
-> The result is a video which is played in 480*270 (instead of 640*360) with much space between the border and the player

Can you fix it?
Title: Re: Another FLV Player
Post by: rphMedia on December 05, 2008, 11:54:56 am
Back to the 16:9 issue. Maybe you have an idea.

It's hard to explain, so please have a look at this example (http://photoalbum.ph.funpic.de/cpg/displayimage.php?pos=-83889):
- The border loads in the correct size (640*360)
- Then the player loads in 4:3 ratio and fits its height to the video height (in this example 480*360)
- Then the player resizes to 16:9 ratio, but in the wrong size. It takes the current width of the player and fits its height to it
-> The result is a video which is played in 480*270 (instead of 640*360) with much space between the border and the player

Can you fix it?

I don't think I can help out much further. My recommendation would be to scale the video to a specific size, but that's totally my opinion. You start running into problems when the source video is all different sizes/bitrates, from playback smoothness to videos too large for the stage - making the player auto-size is mainly for videos that are smaller, not larger. You'd have to know the largest stage available (ie, your 640x360; still kind of large for web deployment). If the player auto-sizes UP, you run the risk of losing the controls and video crop. If you account for the largest video available, then the smaller videos (320x240) look weird in the giant box. Which would you rather have? I hope you understand what I'm trying to say :)
Title: Re: Another FLV Player
Post by: Αndré on December 05, 2008, 12:05:40 pm
I hope you understand what I'm trying to say :)
I think so :)

But maybe you can post the code for:
The only thing I could do is remove the border
I don't know if it helps the person. But an offer doesn't hurt anyone ;)


Thank you.
Title: Re: Another FLV Player
Post by: rphMedia on December 05, 2008, 12:25:16 pm
OK, the attached has no border and auto-sizes.
Title: Re: Another FLV Player
Post by: Αndré on December 05, 2008, 01:15:36 pm
By the way: I have written a simple script, that adds the filetype to the database (because some people had problems with installing and using the Filetype Editor Plugin).

The steps
Firstly you'll need Nibbler's Filetype Editor Plugin (http://forum.coppermine-gallery.net/index.php?topic=24186.msg111120)

Add the filetype "flv     application/x-shockwave-flash     movie     Flash Player"
can be skipped with the help of this script.

Just download the attached file in this post (http://forum.coppermine-gallery.net/index.php/topic,56726.msg277275.html#msg277275), upload the extracted php file to your coppermine root directory and visit it with your browser.


@rphMedia: attach this file to your first post (or include it in your flvPlayer.zip) if you thinks it's useful.
Title: Re: Another FLV Player
Post by: ff on December 17, 2008, 12:23:43 pm

Modify theme.php (ensure the function theme_html_picture() exists).

To bad you have to do this for every theme if you want the users to be able to select their own theme :)
Is this going to be put into v1.5 ;)
Title: Re: Another FLV Player
Post by: karbine on June 26, 2009, 12:53:32 pm
Sorry to sound like a COMPLETE noob but i am new to coppermine so really would appreciate the help.

I Have downloaded step one,nibblers file.   Now from this point i am stuck and confused looking at 3 php files within the zip of nibbles file.

Can you tell me what i need to do after this please.
Title: Re: Another FLV Player
Post by: Αndré on June 26, 2009, 01:14:50 pm
Read http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#plugin
Title: Re: Another FLV Player
Post by: karbine on June 29, 2009, 06:56:59 pm
Read http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#plugin

Which section??
Title: Re: Another FLV Player
Post by: Joachim Müller on June 29, 2009, 08:07:53 pm
The section that eenemeenemuu has refered to that explains exactly what you have asked. >:(
Title: Re: Another FLV Player
Post by: karbine on June 30, 2009, 11:25:55 pm
I have read the section refered to and im still rather lost.   I tried to upload the .zip file to the plugin manager and once it uploads and the page refreshes it still says "No Plugins Installed"?
Title: Re: Another FLV Player
Post by: Αndré on July 04, 2009, 04:10:35 pm
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#plugin_manager_install  ::)
Title: Re: Another FLV Player
Post by: janmanzer411 on September 11, 2009, 06:52:54 am
Hi!
I have done exactly what you described, but it won't work. I just get a completely grey field with no content. If I use gwendolyn's player I get something that looks like a player, but nothing happens when I click on play or any other buttons.

This is the part of theme.php that contains the edits I have done:
Code: [Select]
        // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }

        $player = $players[$user_player];

if ($mime_content['extension'] == "flv") {
$descript = $CURRENT_PIC_DATA['title'];
$pic_html = "<script type=\"text/javascript\" src=\"flashobject.js\"></script><div id=\"flashcontent\" style=\"width: 330px; height: 270px\"></div><script type=\"text/javascript\">var fo = new FlashObject(\"flvPlayer.swf\", \"animationName\", \"330\", \"270\", \"8\", \"#FFFFFF\");fo.addParam(\"allowScriptAccess\", \"sameDomain\");fo.addParam(\"quality\", \"high\");fo.addParam(\"FlashVars\", \"flvPath=$picture_url&flvTitle=$descript\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"flashcontent\");</script>";
} else {
        $pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"src\" value=\"". $picture_url . "\" /><param name=\"ShowControls\" value=\"1\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"ShowStatusBar\" value=\"1\" /><param name=\"ShowDisplay\" value=\"0\" /><param name=\"DisplaySize\" value=\"0\" /><param name=\"autostart\" value=\"$autostart\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" AllowChangeDisplaySize="1" '.' autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";
    }
}

The link to my video in my coppermine gallery is here: http://jostor.com/gallery/displayimage.php?album=1&pos=66 (http://jostor.com/gallery/displayimage.php?album=1&pos=66)

I hope someone can help me, thankyou very much!

I tried this too. Even doing the root folder correctly, but I think it is version hassles stopping from working

Best,
Jan
Jan Manzer (http://janmanzer.com)
Title: Re: Another FLV Player
Post by: Αndré on September 11, 2009, 09:09:32 am
I tried this too. Even doing the root folder correctly, but I think it is version hassles stopping from working

Best,
Jan
Jan Manzer (http://janmanzer.com)
Is this spam or a support request? I can't find a Coppermine installation on your website.
Title: Re: Another FLV Player
Post by: dos3age on October 22, 2009, 04:57:01 pm
I uploaded the "flietype" plugin added the "flv", added the player.swf and flashobject.js to my root.. I added the code to the friuty theme.php right above:
Code: [Select]
// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='';


then I tried adding this current to the theme.php:
Code: [Select]
function theme_html_picture()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $USER;
    global $album, $comment_date_fmt, $template_display_media;
    global $lang_display_image_php, $lang_picinfo;

    $pid = $CURRENT_PIC_DATA['pid'];
    $pic_title = '';

    if (!isset($USER['liv']) || !is_array($USER['liv'])) {
        $USER['liv'] = array();
    }
    // Add 1 to hit counter
    if (!USER_IS_ADMIN && !in_array($pid, $USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        add_hit($pid);
        if (count($USER['liv']) > 4) array_shift($USER['liv']);
        array_push($USER['liv'], $pid);
    }

    if($CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      $condition = true;
    }elseif($CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      $condition = true;
    }elseif($CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      $condition = true;
    }else{
     $condition = false;
    }

    if ($CURRENT_PIC_DATA['title'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if ($CURRENT_PIC_DATA['caption'] != '') {
        $pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if ($CURRENT_PIC_DATA['keywords'] != '') {
        $pic_title .= $lang_picinfo['Keywords'] . ": " . $CURRENT_PIC_DATA['keywords'];
    }

    if (!$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        template_extract_block($template_display_media, 'img_desc');
    } else {
        if (!$CURRENT_PIC_DATA['title']) {
            template_extract_block($template_display_media, 'title');
        }
        if (!$CURRENT_PIC_DATA['caption']) {
            template_extract_block($template_display_media, 'caption');
        }
    }

    $CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    if ($CONFIG['make_intermediate'] && $condition ) {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'normal');
    } else {
        $picture_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    }

    $image_size = compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    $pic_title = '';
    $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);


    if ($mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) {
            $CURRENT_PIC_DATA['pwidth']  = 320; // Default width

            // Set default height; if file is a movie
            if ($mime_content['content']=='movie') {
                $CURRENT_PIC_DATA['pheight'] = 240; // Default height
            }
        }

        $ctrl_offset['mov']=15;
        $ctrl_offset['wmv']=45;
        $ctrl_offset['swf']=0;
        $ctrl_offset['rm']=0;
        $ctrl_offset_default=45;
        $ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        $image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }
    } elseif ($mime_content['content']=='document') {
        $pic_thumb_url = get_pic_url($CURRENT_PIC_DATA,'thumb');
        $pic_html = "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        $autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        $players['WMP'] = array('id' => 'MediaPlayer',
                                'clsid' => 'classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ',
                                'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                'mime' => 'type="application/x-mplayer2" ',
                               );
        $players['RMP'] = array('id' => 'RealPlayer',
                                'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                'codebase' => '',
                                'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               );
        $players['QT']  = array('id' => 'QuickTime',
                                'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                'mime' => 'type="video/x-quicktime" '
                               );
        $players['SWF'] = array('id' => 'SWFlash',
                                'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                'mime' => 'type="application/x-shockwave-flash" '
                               );
        $players['UNK'] = array('id' => 'DefaultPlayer',
                                'clsid' => '',
                                'codebase' => '',
                                'mime' => ''
                               );

        if (isset($_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            $user_player = $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            $user_player = $mime_content['player'];
        }

                  // There isn't a player selected or user wants client-side control
        if (!$user_player) {
            $user_player = 'UNK';
        }

       if ($mime_content['content']=='movie' && $mime_content['mime']=='application/x-shockwave-flash') {
if ($CURRENT_PIC_DATA['pwidth']==0 || $CURRENT_PIC_DATA['pheight']==0) {
$CURRENT_PIC_DATA['pwidth']  = 640; // Default width
                $CURRENT_PIC_DATA['pheight'] = 480; // Default height
}
$CURRENT_PIC_DATA['pwidth']-=26; // black bars on sides for me for some reason

$flv =  $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];

if($mime_content['extension']!='flv') {
$flvcheck = fopen($flv,"r");
$flv=fgets($flvcheck);
fclose($flvcheck);
}
$exxvars=str_replace($CONFIG['thumb_pfx'], $CONFIG['normal_pfx'], get_pic_url($CURRENT_PIC_DATA,'thumb'));
if(!file_exists($exxvars)) $exxvars=get_pic_url($CURRENT_PIC_DATA,'thumb');
$exxvars="&image=".$exxvars;
$pic_html = "<embed src=\"mediaplayer.swf\" width='".$CURRENT_PIC_DATA['pwidth']."' height='".$CURRENT_PIC_DATA['pheight']."' allowfullscreen=\"true\" allowscriptaccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"
flashvars=\"file=$flv$exxvars\"></embed>";


        } else {

        $player = $players[$user_player];

        $pic_html  = '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        $pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\"". $picture_url . "\" />";
        $pic_html .= '<embed '.$image_size['whole'].' src="'. $picture_url . '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        $pic_html .= "</object><br />\n";

}
    }

    $CURRENT_PIC_DATA['html'] = $pic_html;
    $CURRENT_PIC_DATA['header'] = '';
    $CURRENT_PIC_DATA['footer'] = '';

    $CURRENT_PIC_DATA = CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    $params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return template_eval($template_display_media, $params);
}


When I go to view my video I only see "white box" nothing is displayed... I can click on box and get adobe message, and if I download I can view on my desktop but not watch on site?

Here is link:

http://christophers-collection.info/displayimage.php?album=18&pos=8


Any Help?
Thank You
Christopher




Title: Re: Another FLV Player
Post by: rphMedia on October 22, 2009, 06:04:25 pm
I don't know where you acquired your Flash script (pointing to 'mediaplayer.swf', instead of flvPlayer.swf'), but it's not the one I provided.

If you follow the instructions exactly, you won't have any problems.
Title: Re: Another FLV Player
Post by: dos3age on October 22, 2009, 11:00:29 pm
Yes thank you.. I got it working.. just needed to rename player  ::)

Sincerely
Christopher
Title: Re: Another FLV Player
Post by: ligerzero on January 18, 2010, 01:29:53 pm
Can i have help here please?

ive followed all the steps, and now have gotten to the player. But it does nothing, just the play button
http://ligerzero.net/coppermine/displayimage.php?album=lastup&cat=0&pos=1

flvPlayer.swf and flashobject.js are in the root directory already

I am using 1.4.25

Thanks very much. :D
Title: Re: Another FLV Player
Post by: ligerzero on January 19, 2010, 09:27:28 am
had to use the 2nd flashPlayer.swf which was attached here. Works nicely now. :D
Title: Re: Another FLV Player
Post by: Magic2010 on March 24, 2010, 06:54:08 pm
Hi there, is it possible to have the player size like 768x512?
I know can change it in the code, but this make also the buttons bigger.

thank you
Title: Re: Another FLV Player
Post by: Αndré on March 25, 2010, 07:42:17 am
That's not possible with this mod. Try that (http://forum.coppermine-gallery.net/index.php/topic,34182.0.html) mod instead.
Title: Re: Another FLV Player
Post by: andy_cul on April 23, 2010, 06:03:05 pm
i have a Displaying videos from Youtube in Coppermine without fopen & Youtube dev API ID mod on my gallery now im having problem in integrating this mod. please help thanks
Title: Re: Another FLV Player
Post by: Αndré on April 23, 2010, 06:56:30 pm
i have a Displaying videos from Youtube in Coppermine without fopen & Youtube dev API ID mod on my gallery now im having problem in integrating this mod. please help thanks
See here (http://forum.coppermine-gallery.net/index.php/topic,34182.msg321328.html#msg321328). It's the same approach.
Title: Re: Another FLV Player
Post by: andy_cul on May 02, 2010, 04:04:59 am
how to not autostart playing videos?
Title: Re: Another FLV Player
Post by: Αndré on May 02, 2010, 08:57:30 am
how to not autostart playing videos?
Either set your Coppermine configuration accordingly or hardcode autostart to false.
Title: Re: Another FLV Player
Post by: navpaks on May 20, 2010, 09:40:51 pm
Hi Guys

I have intgrated this player into my site and would like to say thanks for your hard work.

I just have one small problem however.

I have 720 x 405 video and I have changed the code as you stated:

>
I think it would look fine, but if you want to change the size of the player permanantly, just input the dimensions in this line (2 places):

Change:
Code: [Select]
$pic_html = "<script type=\"text/javascript\" src=\"flashobject.js\"></script><div id=\"flashcontent\" style=\"width: 330px; height: 270px\"></div><script type=\"text/javascript\">var fo = new FlashObject(\"flvPlayer.swf\", \"animationName\", \"330\", \"270\", \"8\", \"#FFFFFF\");fo.addParam(\"allowScriptAccess\", \"sameDomain\");fo.addParam(\"quality\", \"high\");fo.addParam(\"FlashVars\", \"flvPath=$picture_url&flvTitle=$descript\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"flashcontent\");</script>";

To (your dimensions):


Code: [Select]
$pic_html = "<script type=\"text/javascript\" src=\"flashobject.js\"></script><div id=\"flashcontent\" style=\"width: 480px; height: 360px\"></div><script type=\"text/javascript\">var fo = new FlashObject(\"flvPlayer.swf\", \"animationName\", \"480\", \"360\", \"8\", \"#FFFFFF\");fo.addParam(\"allowScriptAccess\", \"sameDomain\");fo.addParam(\"quality\", \"high\");fo.addParam(\"FlashVars\", \"flvPath=$picture_url&flvTitle=$descript\");fo.addParam(\"wmode\", \"transparent\");fo.write(\"flashcontent\");</script>";>

substituting 720 and 405 in both places but it doesn't resize the player. It loads, sizes to the bottom of the screen and then bounces back where it was.

http://www.ampthill.tv/coppermine14x/displayimage.php?album=lastup&cat=3&pos=0

Can anyone help?

Thanks

Howard
Title: Re: Another FLV Player
Post by: phill104 on May 20, 2010, 09:51:57 pm
Blimey, I didn't know Ampthill had a site (other than the weatherstation). Great village (I'm a Brogborough sailor) who even donated some cash to the windsurfing club.

Back to your problem, did you change the size of the video in it's properties?

http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#edit_vids
Title: Re: Another FLV Player
Post by: navpaks on May 21, 2010, 01:11:05 am
Well Phil, I'm glad you like my weather station. Ampthill is actually a town, not a village by the way.

Yes the properties of the file have been changed to 720 x 405 within coppermine.
Title: Re: Another FLV Player
Post by: navpaks on May 22, 2010, 12:27:16 pm
I've been moving and changing files about and the URL of one of the problem files has changed to

http://www.ampthill.tv/coppermine14x/displayimage.php?album=lastup&cat=3&pos=1

Thanks

Howard