Documentation :: PHP Functions

Here is the documentation for the PHP library provided with the open source FLV player. To use these PHP functions, you need to include the file flash.php, provided in the flash folder.

  • embed - embeds a swf file.
  • flv - embeds an flv video.
  • flvheader - includes AC_RunActiveContent.js for Internet Explorer and rac.js for all other browsers.
  • flvstring - returns the code to embed an flv video.
  • getflvsize - returns the dimensions of an flv file as an array.

Click here to download the GPLv3 License.

PHP Functions
Installation
FAQ

57 Responses to “Documentation :: PHP Functions”

  1. Martin Lindhe says:

    Hello. What licence is the flv player released under? I couldn’t find any notice of licence in the source code or on the site.
    Can i use this on my website without any restrictions?

  2. admin says:

    GNU or GPL. Yes.

  3. juan says:

    nice job! Where can we find the source code?

  4. Jukka says:

    Is this open source? Where is the source code and the license?

  5. Adrian says:

    Hi, I would like to change the color of the upper part of the menue too. Is that possible somehow?

  6. admin says:

    The code is in the fla files. It’s possible to change the menus, but you have to do it in the fla files.

  7. Chuckles says:

    I like the thumbnail overlay in your example. How do you set that in the embed?

  8. Derek Santos says:

    Awesome Player! Does this player have automatic bandwidth detection as well?

  9. marvin says:

    i cant seem to figure out how to change the trackers color
    is that possible because i now have a “kindof” white background but a black tracker

  10. Affandi says:

    is there any limitation on Operating System? does it work when we run under Vista environment. seems to work well with XP..

  11. rudi harsono says:

    is the player support rtmp protocol?

  12. reinne says:

    where can i find the flash folder???

  13. Ricky says:

    Hi, where is the actionscript file? How can I compile the fla? Thanks

  14. N00b says:

    An example using SWFObject would be great.. if possible..

  15. Dhananjoy says:

    Hi, I want to know whether installation of flash plugin is pust for this player? Does it support flv-RTMP-playback in swf files?

  16. lsryp says:

    Hello,

    Is this payer works with flash 7?

    Thanks,

  17. Fentex says:

    I’ve just tested this player, and it’s working just fine thank you, but I’d like to be able to remove the big Play button in the middle of my movie. I want my movies first frame (when autoloaded) to be present as an unobscured image and find the lower left play button satisfactory for beginning the movie.

    I don’t think any of the listed flashvars in any documentation can help me, might this be an addable feature?

  18. Dave says:

    Is it possible to theme the player, such as changing colors? I wanted to have a dark grayish bachground e.g. #1111, with a deep purple instead of red on my site…

  19. Jaime Dias says:

    Hi,

    i have installed and modified a little the demo.php (quick install) to this:

    [code]

    [/code]

    now i would like to know what files i do really need (all the files under flash folder?!?!)

    and how i can change the macromedia url as im getting not secure warnings, and uf macromedia serves https would solve it.

    like here:

    [code]

    var src = ‘player’;
    if(!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0))
    src = ‘player8′;
    AC_FL_RunContent(’codebase’, ‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0′, ‘width’, 400, ‘height’, 390, ’src’, src, ‘pluginspage’, ‘http://www.macromedia.com/go/getflashplayer’, ‘id’, ‘flvPlayer’, ‘allowFullScreen’, ‘true’, ‘movie’, src, ‘FlashVars’,'movie=video.flv&fgcolor=0×006AC3&bgcolor=0×000000&volume=70′);

    [/code]

    this part:

    [code]
    (’codebase’, ‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0′, ‘width’, 400, ‘height’, 390, ’src’, src, ‘pluginspage’, ‘http://www.macromedia.com/go/getflashplayer’, ‘id’, ‘flvPlayer’, ‘allowFullScreen’, ‘true’, ‘movie’, src, ‘FlashVars’,'movie=video.flv&fgcolor=0×006AC3&bgcolor=0×000000&volume=70′);
    [/code]

    would be my guess as the problem, but im really not sure.

    best regards,

  20. Jaime Dias says:

    hi again,

    somehow the code tag didnt worked and my modified demo.php didnt show up, so here it is:

  21. Rasit Özdas says:

    Hi!

    Thank you for this pretty flv player.
    I had some difficulties when I had video play from
    the middle or somewhere. It stops playing.
    Am I missing something, or is it my internet connection causes the problem?

  22. valerie says:

    It’s really nice and thanks for that! However I am trying to get my webpages validated and.. that’s not working :S Is it possible to get this validated? And if yes, how? There are so many errors I don’t even know where to begin.. The whole flash stuff comes out with many many errors.

  23. admin says:

    You can change the colors with the PHP, you can also use the code generator.

  24. admin says:

    Ricky -
    There is no actionscript file, the actionscript for this player is found in frames 1 & 2 of the timeline.

  25. Elliot says:

    I’m looking forward to create a plugin for WordPress using OSFLV. However, I need to ask your permission to redistribute the swf file with the other plugin files (php, js, css) on the WordPress plugins repository. Of course, there will be enough credit to you and the OSFLV website. Let me know what are your thoughts on this.
    Best regards.

  26. Harkonenn says:

    I’m trying to edit the player controls and running into a little trouble. I’ve rearranged the positions of some elements (for example, I placed the current play time to the left of the progress bar). My new layout requires that the progress bar be moved to the right and shortened. It also means that I need to start the slider in a different position and have it respond to the new length and position of the progress bar. Can you give instructions on how to modify the width and X position of the progress bar, as well as what relevant values of the slider to change accordingly? Thanks!

  27. admin says:

    Harkonenn, To change the positions and length of the progress bar, change the Actionscript in the first frame. There is also a function for the slider in the first frame.

  28. Harkonenn says:

    That’s great, thank you!

  29. Daniele says:

    Really thanks, good player.
    I’ve just a little problem. I cannot set the correct path to the player.swf
    Somebody know hot to set a path for the player ???
    Thanks !!!

  30. Drew says:

    Hello,

    I find the concept of an Open Source Flash player a very good idea. I have downloaded and implemented the player on a local testing server. I am having no problems with configuration or modifying it to my needs. However, there is a glaring problem (at least I think) that when you right click anywhere on the movie or the player it says Powered by Jambocast. When you Google Jambocast, you find their website at http://jambomedia.com/jambocast.html On this page it mentions: Jambocast is a Simple Video Solution. After years of internal use, Jambo Media has developed the Jambocast technology for private label licensing for advertising & affiliate networks, content owners, website owners and businesses.

    So It seems pretty obvious to me that this tool may not be so Open Source after all? Could someone please clarify? Thank you.

  31. admin says:

    Drew - Jambo Media owns the OSFLV player. It IS open source and will continue to be open source. However, Jambo Media’s players are not open source. Jambo Media offers paid service Flash Players to advertisers, content owners, website owners and businesses of all sizes. http://www.jambomedia.com/jambocast.html

    What you’re seeing is not a glaring problem.

  32. Drew says:

    OK, well I disagree with you then though I appreciate your response. If it were truly Open Source, then their advertising wouldn’t be embedded when you right click on the Flash player in a web page. Wouldn’t you agree?

  33. Robin Smidsrød says:

    There is a bug in the way the movie parameter is handled. If I ask it to read a file with the name “B%C3%A5tmannsknop.flv” (UTF-8) it actually requests the file “B%E5tmannsknop.flv” (ISO-8859-1) from the server. When will this be fixed?

  34. Zeighy dotNet says:

    @Drew #32

    OSFLV is completely open source, if you know what open-source means, you’d know this is open-source. Since this is open source, you would have the ability to remove your problem with the right-click, but it would be quite rude to do so.

    Other big companies offer some software for free. and the source code can be downloaded separately. They would still add a way to show who made the original code and who are the “partners” or “sponsors” of the software, like in this case with OSFLV. But nonetheless, you could still remove them or at least modify how they are presented or where and when they can be seen.

  35. Viper_iii says:

    can I make the video stretch to fit the player… can’t seem to figure out how to pass this variable.. Seems this should be passable but is it more of a flash var than player config? if so example please?

    thx

  36. admin says:

    @Viper_iii There is no variable set up in the current player to resize the video. That is why the player itself is resizable so that it can scale to fit whatever size video you’ve got. You could tweek the code to add that function but that is not part of the current player’s functionality.

  37. Liu says:

    Can this thing be XHTML Strict?

  38. admin says:

    Yes.

  39. Liu says:

    Fair enough, “never ask yes/no question unless you mean it”.
    What parameter does player.swf need to load its FLV, for example, with this code?
    I don’t need EMBED, Run_ActiveContent, etc. - just XHTML.

    P.S. Currently the Demo page doesn’t pass the W3C validator.

  40. Liu says:

    The code got stripped away. Here it is, add brackets in obvious places.
    object type=’application/x-shockwave-flash’ data=’player.swf’ height=’300′ width=’450′
    param name=’loop’ value=’false’ /
    param name=’movie’ value=’…’ /
    /object

  41. admin says:

    I’m aware of the validation issue, we hope to resolve that issue when an AS3 player is released sometime this year. Thanks.

  42. Liu says:

    It works if I specify movie parameter in the code as
    player.swf?movie=/path/to/video.flv
    However, path to video is really a script like
    /path/to/script.ext?some=parameters&have=values
    How to properly pass that to the player?

  43. Liu says:

    Also, links for comments (the ones with dates) do not work.

  44. Nirmal says:

    Full Screen is not working on single click in second time in Firefox 3.0.7 and Safari 3.2.1., we have to do double click. It worked properly when I click 1st time, after that it only works on double click.

    When this issue will be solved?

  45. Nirmal says:

    Full Screen issue has been resolved in the new version, right?

  46. admin says:

    I don’t believe so. At least it didn’t work for me in demo version. I got it to at least register as a button. Its got me stumped in AS2, I am primarily an AS3 programmer. I am hoping to hold off on the issue until an AS3 player comes along.

  47. Thomas Murphy says:

    Hey thanks for this, I love the retro actionscript in frames thing, brings me back to the good ol’ days, easier to understand if you ask me - although some people label their layers ;). I am busy laughing at all the people asking when things will be fixed! Just fix it, guys, it’s all there on a plate.

  48. jmet says:

    Is there a way to add in some buffering time since my flv is a progressive download?

  49. admin says:

    It would require substantial changes to the actual Actionscript within the FLA. It’s possible but it would not be simple.

  50. jmet says:

    is there a reason why the flv doesn’t fully load. meaning, i’m not seeing the progression bar “fill up”, even when i’ve paused the movie for a few minutes. it gets about 1/2 way filled then just sits there. does that mean the movie stopped loading?

  51. Bill says:

    Thanks a million for such a cool player! Is there a way for a non-programmer like me to change something so the slider (timeline) is functional? When I click it, it just starts the video over again. I can probably change the code if someone could walk me thru it.
    Thanks again!

  52. Bill says:

    Update–I just realized I have to watch the hole video first, then the slider will work. If I try to click on the slider while it’s playing the first time, it just restarts the video. Any way to make the slider work without having to watch the whole video first?
    Thanks ya’ll!

  53. admin says:

    @Bill - is your video streaming? do you have a slow connection? It could be taking a very long time to progressively download your video and that is why the prog bar isn’t working until you watch it again (when it has already been downloaded).

  54. ashish saxena says:

    hello,

    i am using this tool in my site .really nice working but i have one question how to set buffer time. is it possible or not???? please reply as soon as possible.

  55. admin says:

    There is no flash var to set the buffer time however if you opened the FLA file and tweaked the code, I don’t think you would have to add much code to create that functionality.

  56. Mark says:

    Our Apache server was getting pegged hard every time somebody requested a page with this player on it.
    If you don’t set the width and height explicitly, the getID3 function seems to load the entire FLV into memory in order to get the width and the size.
    This is bad for a big video file(or any video file).
    I recommend using ffmpeg-php or hard coding the width and height parameters.

  57. Vimaljamesraj. RVS says:

    Can someone help me how to run mp3, WMV (or other format video and audio files) using OSFLV v3.1
    If there is any option to upgrade it?

Leave a Reply

Copyright Jambo Media, LLC 2009

Powered by WordPress - Created by Tommaso Baldovino