<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IONCANNON &#187; FlowPlayer</title>
	<atom:link href="http://www.ioncannon.net/tag/flowplayer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ioncannon.net</link>
	<description>Thoughts on Software Development and Engineering</description>
	<lastBuildDate>Tue, 03 Jan 2012 13:59:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<atom:link rel='hub' href='http://www.ioncannon.net/?pushpress=hub'/>
		<item>
		<title>How to build FlowPlayer from source</title>
		<link>http://www.ioncannon.net/programming/112/how-to-build-flowplayer-from-source/</link>
		<comments>http://www.ioncannon.net/programming/112/how-to-build-flowplayer-from-source/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 19:29:28 +0000</pubDate>
		<dc:creator>carson</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[FlowPlayer]]></category>

		<guid isPermaLink="false">http://www.ioncannon.net/web-design/112/how-to-build-flowplayer-from-source/</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<p>I have mentioned the <a href="http://flowplayer.sourceforge.net/">free open source flash video player FlowPlayer</a> before in my post about <a href="http://www.ioncannon.net/web-design/109/metadata-cuepoint-flash-video-flvtool/">adding cuepoints</a> and <a href="http://www.ioncannon.net/linux/105/create-flash-videos-ffmpeg/">create flash videos</a>. It is a great free flash video player that you can modify yourself. After writing about <a href="http://www.ioncannon.net/php/110/using-flash-video-metadata-to-display-annotations/">adding  metadata to your flash videos</a> 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.</p>
<p><span id="more-112"></span></p>
<p>FlowPlayer is created using a number of different open source Flash tools. Here is a list of the tools you will need:</p>
<ul>
<li><a href="http://ant.apache.org/">Ant</a>  &#8211; This is used to build the source. It along with a few of the other packages require java to run.</li>
<li><a href="http://sourceforge.net/projects/as2lib/">AS2Ant</a> &#8211; An AS2Lib build tool.</li>
<li><a href="http://sourceforge.net/projects/as2lib/">AS2Lib</a> &#8211; An ActionScript 2.0 application framework.</li>
<li><a href="http://swfmill.org/">SWFMill</a> &#8211; Creates SWF files from XML definitions.</li>
<li><a href="http://www.mtasc.org/">MTASC</a> &#8211; An open source Actionscript compiler.</li>
<li><a href="http://www.luminicbox.com/blog/default.aspx?page=post&#038;id=2">luminicbox.log</a> &#8211; A logging framework for Actionscript.</li>
</ul>
<p>If you want to find out more about these tools you can use <a href="http://www.osflash.org/">osflash.org as a great open source flash resource</a>.</p>
<p>Now that you know what you need it is time to get the source. You can either check it out from the <a href="http://sourceforge.net/cvs/?group_id=133868">FlowPlayer CVS</a> repo or download the <a href="http://sourceforge.net/project/showfiles.php?group_id=133868&#038;package_id=146998">FlowPlayer source distribution</a>.</p>
<p>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.</p>
<div class="codesnip-container" >
<div class="text codesnip" style="font-family:monospace;">cd /tmp/<br />
mkdir flowplayer<br />
cd flowplayer</p>
<p>wget http://apache.mirrors.tds.net/ant/binaries/apache-ant-1.7.0-bin.tar.gz<br />
tar xvzf apache-ant-1.7.0-bin.tar.gz<br />
export ANT_HOME=/tmp/flowplayer/apache-ant-1.7.0/</p>
<p>mkdir aux<br />
cd aux</p>
<p>wget http://umn.dl.sourceforge.net/sourceforge/as2lib/as2ant_2.2.zip<br />
mkdir as2ant<br />
cd as2ant<br />
unzip ../as2ant_2.2.zip<br />
cd ..</p>
<p>wget http://umn.dl.sourceforge.net/sourceforge/as2lib/as2lib_0.9.3_with_dependencies.zip<br />
mkdir as2lib<br />
cd as2lib<br />
unzip ../as2lib_0.9.3_with_dependencies.zip<br />
cd ..</p>
<p>wget http://swfmill.org/releases/swfmill-0.2.11.tar.gz<br />
tar xvzf swfmill-0.2.11.tar.gz<br />
cd swfmill-0.2.11<br />
./configure<br />
make<br />
cd ..</p>
<p>wget http://www.mtasc.org/zip/mtasc-1.12-linux.tgz<br />
mkdir mtasc<br />
cd mtasc<br />
tar xvzf ../mtasc-1.12-linux.tgz<br />
sed -i &#039;/function onStatus/ i\ &nbsp;function onCuePoint(info:Object):Void;&#039; std/NetStream.as<br />
cd ..</p>
<p>wget http://www.luminicbox.com/dev/flash/log/luminicbox.log.zip<br />
unzip luminicbox.log.zip</p>
<p>cd ..</p>
<p>cvs -d:pserver:anonymous@flowplayer.cvs.sourceforge.net:/cvsroot/flowplayer login<br />
cvs -z3 -d:pserver:anonymous@flowplayer.cvs.sourceforge.net:/cvsroot/flowplayer co -P flowplayer</p>
<p>cd flowplayer</p></div>
</div>
<p>Now you have everything you need to build FlowPlayer and you are in the flowplayer source directory. The next step is to change the build.properties file to point to your build tools. If you have followed the above procedure here is a build.properties file that will work:</p>
<div class="codesnip-container" >
<div class="text codesnip" style="font-family:monospace;">AS2ANT_LIB=../aux/as2ant/as2ant.jar<br />
LUMINICBOX_DIR=../aux/LB.Log<br />
AS2LIB_SRC_DIR=../aux/as2lib/src</p>
<p>// plug-in classes for as2lib unit test and asunit to be used with the unit test task<br />
AS2ANT_UNITTEST_DIR=../aux/as2ant/flash<br />
ASUNIT_DIR=../aux/asunit/as25<br />
UNITTEST_FLASHPLAYER=</p>
<p>STD_LIB=../aux/mtasc/std<br />
STD8_LIB=../aux/mtasc/std8<br />
MTASC_BIN=../aux/mtasc/mtasc<br />
SWFMILL_BIN=../aux/swfmill-0.2.11/src/swfmill</p>
<p>// Uncomment following if you want to copy the files to some dir after building<br />
//DEPLOY_DIR=../flowplayer-web/video</div>
</div>
<p>After modifying the build.properties file you are ready to build.</p>
<div class="codesnip-container" >
<div class="text codesnip" style="font-family:monospace;">/tmp/flowplayer/apache-ant-1.7.0/bin/ant</div>
</div>
<p>After the build is complete you will find FlowPlayer in the build directory ready to be used. </p>
<p>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:<br />
src/actionscript/org/flowplayer/FLVController.as</p>
<p>Add the following to the import section:</p>
<div class="codesnip-container" >
<div class="text codesnip" style="font-family:monospace;">import flash.external.ExternalInterface;</div>
</div>
<p>Now find the line in the same file that defines the cuePointCallback function, search for &#034;function cuePointCallback&#034; and add the following line after the function definition:</p>
<div class="codesnip-container" >
<div class="text codesnip" style="font-family:monospace;">ExternalInterface.call(&quot;fpCuePoint&quot;, cuePointInfo.parameters.mydata);</div>
</div>
<p>The above assumes the parameter you want to pass to your function is called &#034;mydata&#034; in your cuepoint. You can then define the javascript function in the page and retreive the data as each cuepoint is hit.</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="kw2">function</span> fpCuePoint<span class="br0">&#40;</span>data<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span>data<span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>Tags: <a href="http://technorati.com/tag/FlowPlayer" rel="tag">FlowPlayer</a>, <a href="http://technorati.com/tag/flash" rel="tag"> flash</a>, <a href="http://technorati.com/tag/flash+video" rel="tag"> flash video</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ioncannon.net/programming/112/how-to-build-flowplayer-from-source/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

