Eddie’s FLV Player

Page style (CSS):

Eddie’s FLV Player

September 18th, 2009 by Eddie Sullivan

I've created a modified and updated version of Neolao's FLV Player. This is a very useful video player for FLV files that you can embed on your web site.

There were some features that I wanted added and some bugs that needed fixing, but there did not seem to be much activity on the original app's message board (at least the English language version), so I decided to make the changes myself.

I took the "MAXI" version of the player, and added in some more JavaScript support, improved some performance issues, and fixed a couple bugs.

Here is what I changed:

  • Fixed some bugs with the slider control.
  • Added to the JavaScript interface the following functions:
    • playVideo
    • pauseVideo
    • getVolume - Gets the volume as a percentage.
    • setVolume - Sets the volume as a percentage.
    • getCurrentTime - Gets the current time in seconds.
    • setCurrentTime - Seeks: takes a new time in seconds
    • isSeeking - Returns true or false
    • isPaused - Returns true or false
    • getDuration - Gets the video length in seconds
  • In the flashVars, you can set a percentage width or height by appending a percent sign to the value. If you set just width percentage and don't set height, the height will be automatically calculated to keep the aspect ratio. Be sure to escape the percent sign as %25. Something like: width=50%25
  • Made seeking more efficient when using phpStream. Now doesn't
    initiate a new connection to the server unless necessary.

Download the player

Download the source code

Here's the original documentation as well as an HTML code generator.

If you have any issues or feature requests, feel free to contact me. Enjoy!

10 Responses to “Eddie’s FLV Player”

  1. Udayan says:

    Hey Eddie,

    Good work on the FLV player. I don't really use the additional javascript features but the slider control is def better.

    Anyways, I am running into an issue where the player doesn't always load. It won't show the controls or anything, and if I right click where the player should be, I don't see the flash menu. I can't figure out a pattern. If it doesn't load, hitting F5 usually works. Any idea what could be going on?

    Thanks.

    Udayan

  2. Hi Udayan.

    Sorry, I don't know what could be causing that problem. Could it possibly be server or connection reliability issues? If you have Firefox, you can use the Firebug plugin to look for error messages in the Console and Network panels. Good luck!

    -Eddie

  3. Leendert says:
    Hi Eddie,

    When having a slow internet connection it will take some time before a movie starts "playing". The only thing you see is an empty player whitout showing any activity. I have tried the buffer parameters but nothing happens :(
    Any idea how to show a buffercounter or an hourglass?

    thanks.

    Leendert
  4. Hi Leendert.

    Check out the original player's documentation here, and try the showloading option to show a message while initially loading or startimage to show an initial screenshot.
    Hope that helps!
    -Eddie
  5. Leendert says:
    Hey Eddiie,
    Thanks for your responce but :( My problem is; when the webpage with the player is loaded it shows the startimage when you click on the play button this image is disapearing and the playerscreen gets black for some time. After the flv is loaded for about 75% then the movie start and also the loadingbar is visuable.

    thanks
  6. Hi Leendert.

    I'm sorry, then, I don't know what could be causing that. Could it be it is showing the first frame of the movie?
    -Eddie
  7. Leendert says:
    Hi Eddie,

    I found thate it probaly is caused by windows 7. On a computer with win-xp it shows (almost) directly the first frame.

    thanks for help. Leendert.
  8. Hi Leendert. Sorry for the trouble. I haven't had the opportunity to test it on Windows 7, so I'm afraid I can't help you debug that.
  9. yitwail says:
    Eddie, The 'original documentation' says very little about phpstream. Would an example be too much to ask? Also, does player work with nginx or lighttpd stream servers? Many thanks.
  10. yitwail says:
    Well, I've managed to get it to sort of work with nginx. I had to change nginx.conf to rewrite the request like so: location ~ \.flv[^.]*$ { root html; if ($args !~ "start=") { rewrite (.*)\.flv(.*) $1.flv?start=$2 break; } flv; } phpstream appends a number to the flv filename, so this converts filename.flv0 to filename.flv&start=0, etc. Only problem I'm now having is that with autoload=0 & autoplay=0, it still loads the flv file, and when the flv finishes playing, it reloads the whole file yet again. Hope there's a workaround.

Leave a Reply