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.

[code lang=”text”]
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:

[code lang=”text”]

// 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.

[code lang=”text”]

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:

[code lang=”text”]
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:

[code lang=”text”]“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.

[code lang=”javascript”]
function fpCuePoint(data)

[tags]FlowPlayer, flash, flash video[/tags]

9 thoughts on “How to build FlowPlayer from source

  1. Anssi

    This is really good information.

    Note that currently the CVS HEAD branch contains sources that are being ported to ActionScript 3.0. This effort is currently in progress and you need different tools for building it.

    The sources that correspond to the insctructions presented here must be checked out from fixes_1_11 branch:

    cvs co -r fixes_1_11 -P flowplayer

    // Anssi

  2. Federico

    As of june 2007, swfmill has released 0.2.12 which will lead to a successfull build but to a broken swf as well. Stick to swfmill 0.2.11.

  3. Kevin

    Very good instruction. I tried to digg it, but the site tells me “topic is invalid”. Ain’t getting it. Maybe I just can’t dig a thing.

    On the subject of swfmill version, the readme file from flowplayer said the same thing, that swfmill 0.2.12 does not work. But I am NOT able to build it at all with swfmill 0.2.11, but only with 0.2.12; with the rest following exactly as above. I am wondering if it has to do with libxlt version. Here are mine:

    libxslt.i386 1.1.21-1.fc6 installed
    libxslt-devel.i386 1.1.21-1.fc6 installed

  4. Deb

    Getting an error aroung “alert” for the function function fpCuePoint(data)
    while building. Could you please let me know the reason?

  5. Pingback: 2fkd » Blog Archive » Building FlowPlayer from Source on Mac OS X

  6. greg

    Answering “deb” at February 19th, 2008 at 4:17 am:

    this function is a sample javascript callback, it should be in your webpage, not in Flowplayer

  7. tan123

    Could you guide me build FlowPlayer 3.0.0 from source?

    I use cygwin, java 6, apache ant 1.7.0 and Flex SDK 3 on Window

    I encountered these errors, one can point me in the right direction?

    Buildfile: build.xml

    [echo] main up-to-date: ${uptodate.main}
    [echo] main up-to-date: ${uptodate.commercial}
    [echo] lib up-to-date: ${uptodate.lib}



    [exec] Loading configuration file C:\flowplayer\flex_sdk_3\frameworks\flexconfig.xml
    [copy] Copying 1 file to C:\flowplayer\bild
    [copy] Copying 1 file to C:\flowplayer.devkit

    [subant] No sub-builds to iterate on



    [echo] Building binary flowplayer.swf
    [exec] command line: Error: configuration variable ‘compiler.define’ expected 2 argument(s), got 1
    [exec] Adobe Compc (Flex Component Compiler)
    [exec] Use ‘mxmlc -help’ for information about using the command line.
    [exec] Result: 1

    C:\flowplayer\build.xml:64: The following error occurred while executing this line:
    C:\flowplayer\build.xml:78: Warning: Could not find file C:\flowplayer\build\flowplayer.swf to copy.

    Total time: 25 second

    Thanks for all the help!

Comments are closed.