I'm not sure where to post this, as it is not really a plug in, but it doesn't really fit in any other forum.
Update (Mar 15):
Fixed a bug where events were not working due to 'playerId' being lost.
Introduction
I was shocked to see that Flowplayer does not support XML feeds, there are plenty of users that need some method of giving their users an embed feature while making it difficult for them to remove any plugins they wish.
I made modifications to the Flowplayer source (thankfully its open source/GPL) and made a patch file anyone can apply to add support for XML 'config' files.
Patch (for flowplayer 3.0.7):
http://code.wojjie.com/flash/flowplayer/patches/XMLPatch-3.0.7.diff
This patch was made against the 3.0.7 source. To apply it on a unix system:
Then you can run 'ant' and build a new flowplayer.swf to use.
To use XML feeds with this patch, you must specify the flashvar 'xml', which you should specify an absolute path (ie:http://domain/get/test.xml) for incase you embed it on other pages. You can either specify it with the javascript API, or directly when embedding the player on your page.
Javascript API:
Embed:
XML Format
The XML file is laid out the same way you would configure flowplayer through the javascript API:
This XML file will hide the controls, and add 'test.flv' to the playlist and make the video link to Google in a new window.
Also, when specifying an XML file it will completely overwrite any other config that is passed to it outside the XML unless you specify 'merge' in the XML file, at which point it will merge the two configurations giving priority to the XML file (XML will override the other config where the collide).
Example:
So if you specify multiple playlist items with the javascript API and you use this XML file, it will keep your playlist, but replace the first item with 'text.flv'.
Last few things before I finish this post:
I will do my best to keep an eye out on this thread.
I can also be contacted via MSN: wojjie [at]] hotmail (dot) com (please do not try to contact me through my website, as it is horribly out of date, I don't even do hosting anymore)
Update (Mar 15):
Fixed a bug where events were not working due to 'playerId' being lost.
Introduction
I was shocked to see that Flowplayer does not support XML feeds, there are plenty of users that need some method of giving their users an embed feature while making it difficult for them to remove any plugins they wish.
I made modifications to the Flowplayer source (thankfully its open source/GPL) and made a patch file anyone can apply to add support for XML 'config' files.
Patch (for flowplayer 3.0.7):
http://code.wojjie.com/flash/flowplayer/patches/XMLPatch-3.0.7.diff
This patch was made against the 3.0.7 source. To apply it on a unix system:
cd [flowplayer src directory]
patch -p0 < XMLPatch-3.0.7.diff
Then you can run 'ant' and build a new flowplayer.swf to use.
To use XML feeds with this patch, you must specify the flashvar 'xml', which you should specify an absolute path (ie:http://domain/get/test.xml) for incase you embed it on other pages. You can either specify it with the javascript API, or directly when embedding the player on your page.
Javascript API:
$f("player", "/flowplayer/flowplayer.swf", {'xml':'http://domain/get/test.xml'});
Embed:
<object id="player_api" height="300" width="400" type="application/x-shockwave-flash" data="/flowplayer/flowplayer.swf">
<param name="movie" value="/flowplayer/flowplayer.swf" />
<param value="true" name="allowfullscreen"/>
<param value="always" name="allowscriptaccess"/>
<param value="high" name="quality"/>
<param value="#000000" name="bgcolor"/>
<param value="xml=http://domain/get/test.xml" name="flashvars"/>
</object>
XML Format
The XML file is laid out the same way you would configure flowplayer through the javascript API:
<flowplayer>
<plugins>
<controls display="none" ></controls>
</plugins>
<playlist url="test.flv" linkUrl="http://www.google.com" linkWindow="_blank" ></playlist>
<playlist url="test.flv"" ></playlist>
</flowplayer>
This XML file will hide the controls, and add 'test.flv' to the playlist and make the video link to Google in a new window.
Also, when specifying an XML file it will completely overwrite any other config that is passed to it outside the XML unless you specify 'merge' in the XML file, at which point it will merge the two configurations giving priority to the XML file (XML will override the other config where the collide).
Example:
<flowplayer merge="1">
<plugins>
<controls display="none" ></controls>
</plugins>
<playlist url="test.flv" linkUrl="http://www.google.com" linkWindow="_blank" ></playlist>
<playlist url="test.flv"" ></playlist>
</flowplayer>
So if you specify multiple playlist items with the javascript API and you use this XML file, it will keep your playlist, but replace the first item with 'text.flv'.
Last few things before I finish this post:
- you don't have to use 'flowplayer' as the top XML node, you can essentially use anything you want, the player ignores it.
- any events used with the javascript API are not passed to the player through flashvars, and therefore will still work even if 'merge' is not set
- using an XML config file does not replace javascript event listeners, so if you are wanting to hide the controls before a given clip, you will have to use javascript, or modify the Flowplayer source to add config support for this. (I am actually working on this one at the moment for someone)
- I am new to Flash development, but have been a programmer all my life and know many different languages, so it was easy to pick up. The only thing is, since I am new, I may have not developed this in the most clean/proper way.
- When adding support for XML, I tried to modify the code in a way that would be easiest to implement into future versions (incase the flowplayer team does not add support for XML soon)
I will do my best to keep an eye out on this thread.
I can also be contacted via MSN: wojjie [at]] hotmail (dot) com (please do not try to contact me through my website, as it is horribly out of date, I don't even do hosting anymore)