So, I was successful in part one of my journey, that is , to create a FlowPlayerLibrary.swc which can be added to a flex project and used to add a flex flowplayer component to a project.
I created a flex library project, then captured just about every class from the core, common, controls repositories (within the free, builtin and commercial sub packages), then rearranged them into a contiguous package structure, and then tracked down those other references that the compiler complained about in the fla/swf/swc libraries inside the various lib directories throughout the projects.
Still lots of compiler complaints from all the compiler flags throughout the project which were satisfied with the build xml file in an ant build but I had to add them as compiler options in a large ungainly compiler argument. (probably a better way to do this but I am inexperienced at special building within flex). My compiler arg was something like this:
-locale en_US -define=CONFIG::hasSlowMotion,false -define=CONFIG::debug,false -define=CONFIG::skin,false -define=CONFIG::commercialVersion,false -define=CONFIG::versionStatus,"'dev'" -define=CONFIG::version1,3 -define=CONFIG::version2,2 -define=CONFIG::version3,3 -define=CONFIG::audioVersion,'3.2.0' -define=CONFIG::controlsVersion,'3.2.1' -define=CONFIG::freeVersion,true
Then, voila, the thing built and I had my library. Unfortunately, I think that was the easy part.
I would have thought that once I had the library, I could just add a flowplayer component to my project, constructing it with the minimum parameters and having the contstructor handle the defaults:
- I want to pass it a controller reference to supply the controls
- I want to pass it a url pointing to a media source (or a playlist of sources)
- I want to set its size to meet my layout requirements
everything else should be defaulting to a default configuration (colour, background, border, skins...)
No such luck on that constructor. Here is what the constructor looks like:
public function Flowplayer(
stage:Stage,
pluginRegistry:PluginRegistry,
panel:Panel,
animationEngine:AnimationEngine,
canvas:StyleableSprite,
errorHandler:ErrorHandler,
config:Config,
playerSWFBaseURl:String) {
super(stage, pluginRegistry, panel, animationEngine, errorHandler, config, playerSWFBaseURl);
_canvas = canvas;
}
None of the parameters default. The API has no information about the meaning of any of these parameters. So to construct a flowplayer, the flex developer must first construct a plugin directory, an animation engine, a styleableSprite canvas, an ErrorHandler, a Config object.
I started doing this but got hung up mostly on the Config object. The Config object has some of the stuff I wanted to see in the flowplayer constructor (controlsVersion some config stuff) but the most confusing thing for me was that it included the playerSwfUrl which is used by the PluginBuilder as some sort of self-referernence to....to.....to build the plugin that this Config object is already part of??? And the PluginBuilder seems almost a super of the Config object, but doesn't seem to use the playerSwfURL for anything.
So I'm blocked there - the question is how deep do I want to delve to figure out how to make the most simple construction of a flowplayer video player. The worst thing is that there is no documentation from the standpoint of a developer trying to change or extend the player. I'm guessing at a lot of stuff and likely making bad guesses for the mostpart.
From Thomas' description of the linkage of the size to the stage, I think that is would be easy to break that linkage and link its size to the container I put the player in.
However, if I continue, I will create an orphan that is difficult to benefit from continued development on the flowplayer because of the lengthy process I just described to get it into the flex world. But the worst part is that the only way for me to progress is to read code and try to figure out what's going on.
To end this with a question, I guess it would be....Is there some work going on in flowplayer to provide documentation for understanding (and extending) this thing? At this point, as I mentioned, I am not looking to extend the feature set at this point, just to make this thing usable in a flex/flash application.