FLV Player Integration MOD - Page 2 FLV Player Integration MOD - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

FLV Player Integration MOD

Started by gwendolyn, July 24, 2006, 02:39:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

orTubes

Also already I made an modification to use FLV in the site, I am using the FLOWPLAYER. The result was excellent, sees... http://www.ortubes.com

popersman

Quote from: orTubes on January 24, 2007, 08:47:47 PM
Also already I made an modification to use FLV in the site, I am using the FLOWPLAYER. The result was excellent, sees... http://www.ortubes.com
I'm using firefox with Adblock, which is an extension allowing to block advertising. I cant see your videos. I am guessing this is due to the close integration of adsense with your videos.

Can you compare performance with the flash player mentioned before?

taiboi

Hello -

Thank you for the instructions. I got flv to work on my website. I copied the code from Jape reply. It worked great with my eyeball theme. I do need help with one little thing though. How can I make the video play automatically without having to hit play button on the flv player?

popersman

Quote from: popersman on January 24, 2007, 06:45:44 PM
That's a great mode!! I love it!!

On another hand,
I tried to modify the dimensions of the flv video in the following line:
$pic_html  = "<object type=\"application/x-shockwave-flash\" width=\"320\" height=\"260\" wmode=\"transparent\" data=\"flvplayer.swf?file=$flv?autoStart=false\">";

I replaced it by
$pic_html  = "<object type=\"application/x-shockwave-flash\" width=\"640\" height=\"480\" wmode=\"transparent\" data=\"flvplayer.swf?file=$flv?autoStart=false\">";

I am doing this since i kept a VGA resolution for my flv videos. The issue is that while in 320x260 the video run smooth, in vga resolution it plays image by image instead.
Here is a link to the page playing in vga: http://ed.roquette.free.fr/photo/displayimage.php?album=87&pos=0

Is this because playing VGA resolutions is too demanding on the server?

The problem was not coming from the gallery or the server, but was due to the computer i was using  :-[

taiboi

Quote from: taiboi on January 24, 2007, 09:52:59 PM
Hello -

Thank you for the instructions. I got flv to work on my website. I copied the code from Jape reply. It worked great with my eyeball theme. I do need help with one little thing though. How can I make the video play automatically without having to hit play button on the flv player?

I guess it makes sense to post the code I used, before anyone can help.

here is the code

// 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';
        }

        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];

        $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);
}


popersman

Quote from: popersman on January 24, 2007, 06:50:56 PM
I've seen that done by rphMedia on his website (http://gallery.rphmedia.net/), albeit he was using wmv file (see here.
I'd be pretty curious to see how he does that.
rphMedia has PMed me to let me know that he had manually added the thumbnail.

phill104

I'm probably being thick but I cannot get videos to appear in any size larger than this

http://www.windsurf.me.uk/cpg133/displayimage.php?pos=-1424

Am I just missing something?

I just want videos to be able to be viewed in the size they were uploaded at.
It is a mistake to think you can solve any major problems just with potatoes.

Nibbler

This mod hardcodes the dimensions. Try changing


$pic_html  = "<object type=\"application/x-shockwave-flash\" width=\"320\" height=\"260\" wmode=\"transparent\" data=\"flvplayer.swf?file=$flv?autoStart=false\">";


to


$pic_html  = "<object type=\"application/x-shockwave-flash\" ".$image_size['whole']." wmode=\"transparent\" data=\"flvplayer.swf?file=$flv?autoStart=false\">";

phill104

That's done the trick :)

Thanks for your help, I was running out of hair.
It is a mistake to think you can solve any major problems just with potatoes.

orTubes

Unhappyly it does not function with the FIREFOX, only with the IE. Already I tested the IE7 and functioned perfectly, who to know the solution informs me.  ???

Quote from: popersman on January 24, 2007, 09:21:02 PM
I'm using firefox with Adblock, which is an extension allowing to block advertising. I cant see your videos. I am guessing this is due to the close integration of adsense with your videos.

Can you compare performance with the flash player mentioned before?

popersman

I can see my videos without any problem, after implementing the solution given by Nibbler.

Here is an example.

However i still have a strange looking 640x480 window in which videos with smaller resolution plays. Here is an example.

easyjava

I've done the french traduction of the hack ;-)

Jerzxu

So here, I am reading this, the video works perfect. But you see, on my gallery I also have enabled .swf files. Now odd things is, that they don't work while this is installed. Is there a way to fix this at all?

fallenxstar

I think I'm doing something wrong, but I don't know what. All I get is a blank screen:

http://yingna.yinten.com/gallery/displayimage.php?album=4&pos=0

Jerzxu

Quote from: Jerzxu on March 05, 2007, 07:58:44 AM
So here, I am reading this, the video works perfect. But you see, on my gallery I also have enabled .swf files. Now odd things is, that they don't work while this is installed. Is there a way to fix this at all?

Never mind, it fixed itself.

Jerzxu

Quote from: Jerzxu on March 06, 2007, 05:18:14 AM
Never mind, it fixed itself.
My problem, isn't fixed. Well it is, if your using internet explorer(which mine is glitched). Firefox doesn't seem to work with the other swf's but the flv player works.

empfl

hello to all,

i want to modify coppermine as before described. I'll tried to copy the modified function into the theme
i had chosed. But always i get teh following error message:

""" Parse error: syntax error, unexpected $end in /usr/export/www/vhosts/funnetwork/hosting/empfl/cpg1410/themes/mac_ox_x/theme.php on line 369 """

What did i wrong ???

Nibbler

You didn't copy the code correctly, probably missed out one of the closing braces.

empfl

thx nibbler,

sometimes it work's suddenly on the second try ;-)

regards

jayjay01

Hello everyone,

I apologize if this has been answered but i've looked everywhere both here on copermine and on JW's site. I tried to make this modification but
my FLV files are not loading (or playing) all I get is a blank white screen. This is the case weather I am trying to view it on any browser (fire fox, IE 6, and IE 7).

I've tried all kinds of diffrent things like moving the files to different directories but nothing works.

Here is what I did:
1) I download the the FileType plug in and added the flv extension, application/x-shockwave-flash, movie and Flash Player to the list.
2) I then downloaded the Flash Video Player from JW's website and uploaded it to the root of the gallery (http://www.oiucmglobal.com/v2/gallery/).
3) I then uploaded a flv video (320K) using the Coppermine interface, wrote a description, type in the dimensions, and selected a album.

When I try to view as I said I get a white blank screen nothing else nothing at all.
Another thing that I noticed when the vieo file was uploaded it uploaded it to the gallery/albums/userpics/10001 directory and not the album I choose. Is this ok?
You should know that I am uploading the photos via batch and adding the videos via the coppermine upload interface one at a time. ANY HELP WOULD BE GREATLY APPRECIATED.
I have to get this site launched by monday 3/19/2007. Please help!!

Again here is the URL to the gallery: http://www.oiucmglobal.com/v2/gallery/

Below is my theme.php file ( I am using the default theme, classic). Thank you again.


<?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) $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //
define('THEME_IS_XHTML10_TRANSITIONAL',1);


// 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];

        //---$pic_html  = '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
   $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";

      }


?>


Than you everyone!