FLV Plugin FLV Plugin
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

FLV Plugin

Started by hunt0777, August 11, 2010, 05:08:07 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

hunt0777

Ok, the last time I was here, you guys did an amazing job helping me code, the codebase.php file for the FLV plugin.  I wanted to add a plugin for the FLV plugin, LOL, called tip-jar, which creates a donations popup in the FLV player window, evertime the pause button is pressed.  And that was amazing!! Still works, but actually, only in IE, not Firefox. But, that's ok. Thanks.
Now I would like to change some of the variables to the player, but can't see how.  I see how to add parameters, but not variables. Can you please help. 
These are the variables I would like to add:
   <backcolor>003366</backcolor>
   <frontcolor>FFFFFF</frontcolor>
   <lightcolor>888888</lightcolor>
   <volume>100</volume>
   <autostart>true</autostart>
   <stretching>exactfit</stretching>

And here is the codebase.php file, code(the last section of code), for the JW FLV player plugin....
function flv_player_other_media($pic_html) {
    global $CURRENT_PIC_DATA;
    if ($CURRENT_PIC_DATA['extension'] == "flv") {
        global $CONFIG;
        $CURRENT_PIC_DATA['pheight'] += 20;
        $thumb = get_pic_url($CURRENT_PIC_DATA, 'thumb');
        $file = $CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'fullsize');

        if ($CONFIG['media_autostart'] == 1) {
            $autostart = "true";
        } else {
            $autostart = "false";
        }

        $pic_html  = "<object type=\"{$CURRENT_PIC_DATA['mime']}\" width=\"{$CURRENT_PIC_DATA['pwidth']}\" height=\"{$CURRENT_PIC_DATA['pheight']}\" data=\"plugins/flv_player/player.swf?file=$file&image=$thumb&autostart=$autostart\">";
        $pic_html .= "<param name=\"movie\" value=\"plugins/flv_player/player.swf?file=$file&image=$thumb&autostart=$autostart\" />";
        $pic_html .= "<param name=\"allowfullscreen\" value=\"true\" />";
        $pic_html .= "</object>";
    }
    return $pic_html;
}

Can you pleae help???
Thanks.

Αndré

Use that plugin and adjust it to your needs.

hunt0777

huh? Of course.  It all works, I just don't know how to change the script so that I can add variables, and change the player color/skin.  thanks.

Αndré

Please open codebase.php and find
        $player .= "&backcolor={$style['background']}";
        $player .= "&frontcolor={$style['color']}";
        $player .= "&lightcolor={$style['color']}";

Here you can modify the colors and even add more parameters.

hunt0777

hey Andre, I really appreciate your responding. Thanks. 
I must have gotten some different code, because I don't have that code in my codebase.php file for the FLV player plugin. 
This is what I have:  Can you tell me where to put that code you wrote in the above reply in the codebase.php file? Once again, thank you soooooooo much!!

<?php
/**************************************************
  Coppermine 1.5.x Plugin - FLV Player
  *************************************************
  Copyright (c) 2009 eenemeenemuu
  *************************************************
  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 3 of the License, or
  (at your option) any later version.
  ********************************************
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/branches/cpg1.5.x/plugins/flv_player/codebase.php $
  $Revision: 7119 $
  $LastChangedBy: gaugau $
  $Date: 2010-01-24 21:39:28 +0100 (So, 24 Jan 2010) $
  **************************************************/

if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

$thisplugin->add_action('plugin_install','flv_player_install');
$thisplugin->add_action('plugin_uninstall','flv_player_uninstall');
$thisplugin->add_action('plugin_cleanup','flv_player_cleanup');

$thisplugin->add_filter('html_other_media','flv_player_other_media');


function flv_player_install() {
    global $CONFIG;
    if (mysql_result(cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_FILETYPES']} WHERE extension = 'flv'"),0) == "0") {
        cpg_db_query("INSERT INTO {$CONFIG['TABLE_FILETYPES']} (extension,mime,content,player) VALUES ('flv','application/x-shockwave-flash','movie','SWF')");
    } else {
        cpg_db_query("UPDATE {$CONFIG['TABLE_FILETYPES']} SET mime = 'application/x-shockwave-flash', content = 'movie',player = 'SWF' WHERE extension = 'flv'");
    }
    if (strpos($CONFIG['allowed_mov_types'], 'flv') === FALSE) {
        cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '{$CONFIG['allowed_mov_types']}/flv' WHERE name = 'allowed_mov_types'");
    }
    return true;
}


function flv_player_uninstall() {
    $superCage = Inspekt::makeSuperCage();

    if (!$superCage->post->keyExists('drop')) {
        return 1;
    }

    if (!checkFormToken()) {
        global $lang_errors;
        cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__);
    }

    if ($superCage->post->getInt('drop') == 1) {
        global $CONFIG;
        $allowed_mov_types = str_replace('/flv', '', $CONFIG['allowed_mov_types']);
        $allowed_mov_types = str_replace('flv/', '', $allowed_mov_types);
        $allowed_mov_types = str_replace('flv', '', $allowed_mov_types);
        cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '$allowed_mov_types' WHERE name = 'allowed_mov_types'");
        cpg_db_query("DELETE FROM {$CONFIG['TABLE_FILETYPES']} WHERE extension = 'flv'");

        return true;
    }
}


function flv_player_cleanup($action) {
    $superCage = Inspekt::makeSuperCage();
    $cleanup = $superCage->server->getEscaped('REQUEST_URI');
    if ($action == 1) {
        global $lang_common;
        list($timestamp, $form_token) = getFormToken();
        echo <<< EOT
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="tableb">
                        Playback of existing flv files won't work anymore!
                    </td>
                    <td class="tableb">
                        <form action="pluginmgr.php" method="post">
                            <input type="submit" name="submit" value="{$lang_common['back']}" class="button" />
                        </form>
                    </td>
                    <td class="tableb">
                        <form action="{$cleanup}" method="post">
                            <input type="hidden" name="drop" value="1" />
                            <input type="hidden" name="form_token" value="{$form_token}" />
                            <input type="hidden" name="timestamp" value="{$timestamp}" />
                            <input type="submit" name="submit" value="{$lang_common['continue']}" class="button" />
                        </form>
                    </td>
                </tr>
            </table>
EOT;
    }
}


function flv_player_other_media($pic_html) {
    global $CURRENT_PIC_DATA;
    if ($CURRENT_PIC_DATA['extension'] == "flv") {
        global $CONFIG;
        $CURRENT_PIC_DATA['pheight'] += 20;
        $thumb = get_pic_url($CURRENT_PIC_DATA, 'thumb');
        $file = $CONFIG['ecards_more_pic_target'].get_pic_url($CURRENT_PIC_DATA, 'fullsize');

        if ($CONFIG['media_autostart'] == 1) {
            $autostart = "true";
        } else {
            $autostart = "false";
        }

        $pic_html  = "<object type=\"{$CURRENT_PIC_DATA['mime']}\" width=\"{$CURRENT_PIC_DATA['pwidth']}\" height=\"{$CURRENT_PIC_DATA['pheight']}\" data=\"plugins/flv_player/player.swf?file=$file&image=$thumb&autostart=$autostart\">";
        $pic_html .= "<param name=\"movie\" value=\"plugins/flv_player/player.swf?file=$file&image=$thumb&autostart=$autostart&plugins=tipjar,ltas&ltas.cc=ekroxfhipgxivwz&tipjar.business=disciplesofchristd@yahoo.com&tipjar.title=Make%20a%20Donation&tipjar.text=If%20you%20have%20been%20blessed%20by%20our%20online%20sermons%20please%20consider%20making%20a%20donation&tipjar.show_pause=true&tipjar.show_complete=true\" />";
        $pic_html .= "<param name=\"allowfullscreen\" value=\"true\" />";
      $pic_html .= "<param name=\"allowfullscreen\" value=\"true\" />";
        $pic_html .= "</object>";
    }
    return $pic_html;
}


?>

Αndré

As I already told you:
Quote from: Αndré on August 11, 2010, 05:24:45 PM
Use that plugin and adjust it to your needs.

hunt0777

Ok, I must be blind. But you told me to modify the code:

$player .= "&backcolor={$style['background']}";
        $player .= "&frontcolor={$style['color']}";
        $player .= "&lightcolor={$style['color']}";

in the codebase.php file.

And then I said, there is not code like that in the file. (and then attached all the code for you to see yourself)

And then you said, "I told you." 

I am so confused. I feel like I am talking in circles.

Αndré

Click this link for the plugin you should modify (it's another one than you already use): http://forum.coppermine-gallery.net/index.php/topic,62704.0.html

hunt0777

ok.  problem solved.  Thank you Andre, for your patience. Thanks.

hunt0777

to anybody who might read this topic, this is what happened.

The codebase.php file I had was for the JW FLV player (Longtail), and the solution he gave me was, code for a Flash Media Player.  It's not the same code, and not the same player.
So I download cpg1.5.x_plugin_flash_media_player_v1.6, and there, you can change the color of the skin, in the codebase.php file in that player type.  But that's not the same player I had, and the code is completely different.

I think I am going to stay with the JW FLV Player, cause you can add a donations link, and can even run post-pre-mid roll commercials, and advertisements for free. 
Thanks.

Αndré

Quote from: hunt0777 on August 13, 2010, 12:19:03 AM
But that's not the same player I had, and the code is completely different.
It's the same player, but just another version. The 'Flash Media Player' plugin uses a newer version, as the development of the 'FLV Player' has been stopped in advance of the 'Flash Media Player' plugin. That's exactly what you can read in the announcement thread. Please read them more carefully in the future.

Just replace the swf file and you should be fine. And please read carefully the name of the plugins! There's no plugin with the name 'JW FLV Player'.

hunt0777

I apologize.  Although it's not a "JW" FLV plugin, I use, JW Longtail http://www.longtailvideo.com/ for plugins for the FLV Player plugin, like the one you see in the script above, called tipjar, (which brings up a donations box when someone hits the pause button, and also, one called AdSolution (, that allows me to run ads,) --&plugins=tipjar,ltas&ltas.cc=ekroxfhipgxivwz--that part of the script. So yah, I see, about the FLV player.  I am sorry for saying the wrong thing.  I was only trying to help.
Thanks Andre for your help.