Advanced search  

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]

Pages: [1] 2 3 4 5 ... 7   Go Down

Author Topic: Another FLV Player  (Read 263152 times)

0 Members and 1 Guest are viewing this topic.

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Another FLV Player
« on: April 18, 2007, 02:40:41 pm »

This is a basic FLV Player similar to this mod HERE 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

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 & HERE

There's also a client-side player I made HERE 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).
« Last Edit: September 19, 2008, 03:24:51 pm by rphMedia »
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Another FLV Player
« Reply #1 on: April 18, 2007, 02:45:19 pm »

Nice work rph!
Logged

freeedy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 45
Re: Another FLV Player
« Reply #2 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
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Another FLV Player
« Reply #3 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.

freeedy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 45
Re: Another FLV Player
« Reply #4 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.
Logged

freeedy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 45
Re: Another FLV Player
« Reply #5 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?
Logged

danwanner

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Another FLV Player
« Reply #6 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Another FLV Player
« Reply #7 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.
Logged

danwanner

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Another FLV Player
« Reply #8 on: May 16, 2007, 07:07:12 pm »

Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Another FLV Player
« Reply #9 on: May 19, 2007, 02:09:02 pm »

haga45

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
    • HagaWeb Software Solutions
Re: Another FLV Player
« Reply #10 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!!
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Another FLV Player
« Reply #11 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>";

haga45

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
    • HagaWeb Software Solutions
Re: Another FLV Player
« Reply #12 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
Logged

edoitaly

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Another FLV Player
« Reply #13 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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Another FLV Player
« Reply #14 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.
Logged

edoitaly

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Another FLV Player
« Reply #15 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?
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Another FLV Player
« Reply #16 on: May 28, 2007, 06:32:36 pm »

It's in the original attachment, first post.

jostor

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Another FLV Player
« Reply #17 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

I hope someone can help me, thankyou very much!
Logged

rphMedia

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 515
  • ***muvipix.com***
    • muvipix - Music | Video | Pictures
Re: Another FLV Player
« Reply #18 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.

jostor

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Another FLV Player
« Reply #19 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?
Logged
Pages: [1] 2 3 4 5 ... 7   Go Up
 

Page created in 0.034 seconds with 20 queries.