IPlayer is a web-base FLV Player, which I created in 2006 for a project done at VDI, it has been modified over the years gaining more functionality. IPlayer was coded originally in Actionscript 1.0, then upgraded to Actionscript 2.0, future versions may look at implementing Actionscript 3.0.
To install IPlayer simply put the IPlayer.swf file into a web directory on your server. Then do the same with the IPlayer.js file, they don’t have to be in the same directory for example one could be in the js directory and the other could be in the flash directory the choice is yours. The rest of the files in the download package are source files and example movies, they are not needed to use IPlayer only if you are interested in modifying it.
To get IPlayer working is pretty simple, there are a few steps needed to get it working I will go through them now.
Basically in this step we need to add the IPlayer.js file to the HTML page we want to display our movie on. Let’s assume that our IPlayer.js file is located in a fold on the web root called js and your HTML page is located on the web root. Remember this is an example you may change directory names, and locations to suit your needs. Now simply add this code to your page between the HEAD tags:
[/code] That is it for the step 1, now on to step 2.
Step 2 (Calling js function to load the Player)
The function loadplayer has 7 parameters:
- Player Location: This parameter indicates where IPlayer.swf is located, in this example it is located on the web root, but as stated before it can be located anywhere in your web directories e.g. (/flash, /player, /flash/IPlayer…)
- Width: The width of the flv file.
- Height: The height of the flv file.
- Position: Where IPlayer will be placed on the page, values for this are ‘left’, ‘middle’, ‘right’
- Background Color: disabled in this version.
- Movie: The web directory where the movie is located along with the name of the movie. Once again this value is anywhere you want your flvs to be located, and remember that the path must be relative to the HTML page.
- Buffer: The amount of time the Movie will buffer before being able to start playing. In this version of IPlayer the buffer time is always 10, later version will have control of how much buffer time is used.
Step 3: More Functionality
Here is a description of the parameters used in reloadplayer:
- Movie: This is the path to the FLV relative to the HTML page. In the example above a variable was used to represent the path to the movie. You may use a string variable if you want e.g. “movie/move.flv”
- Buffer: Same as the loadplayer function 10 is the only acceptable number.
- Width: The width of the flv.
- Height: The height of the flv.
That’s it for the walk through, as you can see its pretty easy to implement a simple page with a movie player on it.
The download of IPlayer contains the exact same HTML code used in the above example called example.html, it also includes all the source files as well as 2 flvs for testing purposes.
If there is any other questions please feel free to leave a comment below and I will try and help out to the best of my ability.