How to build FlowPlayer from source

I have mentioned the free open source flash video player FlowPlayer before in my post about adding cuepoints and create flash videos. It is a great free flash video player that you can modify yourself. After writing about adding metadata to your flash videos I decided to add support for calling javascript from FlowPlayer one cue events. The first step to modifying the FlowPlayer source is to be able to build FlowPlayer from source.

FlowPlayer is created using a number of different open source Flash tools. Here is a list of the tools you will need:

  • Ant – This is used to build the source. It along with a few of the other packages require java to run.
  • AS2Ant – An AS2Lib build tool.
  • AS2Lib – An ActionScript 2.0 application framework.
  • SWFMill – Creates SWF files from XML definitions.
  • MTASC – An open source Actionscript compiler.
  • luminicbox.log – A logging framework for Actionscript.

If you want to find out more about these tools you can use as a great open source flash resource.

Now that you know what you need it is time to get the source. You can either check it out from the FlowPlayer CVS repo or download the FlowPlayer source distribution.

The following shows how I went about gather all the tools and source for the build. I assume here that you have java already installed.

cd /tmp/
mkdir flowplayer
cd flowplayer

tar xvzf apache-ant-1.7.0-bin.tar.gz
export ANT_HOME=/tmp/flowplayer/apache-ant-1.7.0/

mkdir aux
cd aux

mkdir as2ant
cd as2ant
unzip ../
cd ..

mkdir as2lib
cd as2lib
unzip ../
cd ..

tar xvzf swfmill-0.2.11.tar.gz
cd swfmill-0.2.11
cd ..

mkdir mtasc
cd mtasc
tar xvzf ../mtasc-1.12-linux.tgz
sed -i '/function onStatus/ i\  function onCuePoint(info:Object):Void;' std/
cd ..


cd ..

cvs login
cvs -z3 co -P flowplayer

cd flowplayer

Now you have everything you need to build FlowPlayer and you are in the flowplayer source directory. The next step is to change the file to point to your build tools. If you have followed the above procedure here is a file that will work:


// plug-in classes for as2lib unit test and asunit to be used with the unit test task


// Uncomment following if you want to copy the files to some dir after building

After modifying the file you are ready to build.


After the build is complete you will find FlowPlayer in the build directory ready to be used.

Now that you can build FlowPlayer lets modify it so a javascript function gets called when a cuepoint is hit. To do that you will need to edit the file:

Add the following to the import section:

import flash.external.ExternalInterface;

Now find the line in the same file that defines the cuePointCallback function, search for "function cuePointCallback" and add the following line after the function definition:"fpCuePoint", cuePointInfo.parameters.mydata);

The above assumes the parameter you want to pass to your function is called "mydata" in your cuepoint. You can then define the javascript function in the page and retreive the data as each cuepoint is hit.

function fpCuePoint(data)

Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *