Another FLV Player Another FLV Player
 

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

Another FLV Player

Started by rphMedia, April 18, 2007, 02:40:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rphMedia

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:$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:$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).

Hein Traag


freeedy

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

rphMedia

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

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.

freeedy

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?

danwanner

*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

Joachim Müller

Quote from: danwanner on May 16, 2007, 04:36:44 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.



haga45

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!!

rphMedia

Quote from: 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?

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:
$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):
$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

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

edoitaly

OK, a questo punto mi sento un defi...    :-[ :-[
dove trovo questo file: flashobject.js
che devo mettere in root?

Joachim Müller

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.

edoitaly

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?

rphMedia

It's in the original attachment, first post.

jostor

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:
        // 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!

rphMedia

You need to put the flvPlayer.swf and flashobject.js (attached in first post) in your gallery root, then try again.

jostor

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?