Building plugins and configuration into the player create your custom Flowplayer build
Introduction
Starting with Flowplayer 3.1.2 it has been possible to build a Flowplayer version that has plugins compiled into the Flowplayer SWF file. This means that that there is only one Flash SWF file that holds all required plugins. By compiling the plugins into the player you can simplify the configuration that is visible in HTML pages. This is possible because you can also hardwire configuration options by compiling them into the player.
Preparing your custom player
First you need to have your development environment ready so that you can compile the player and the plugins you intend to use with your custom compiled Flowplayer. Once you have the development environment ready you can continue with the instructions that follow here.
The plugins and the configuration that you want to compile into the player is all defined in src/actionscript-builtin/BuiltInConfig.as that is included in the player sources. The default file in the Flowplayer Subversion repository contains the standard Flowplayer plugins all commented out.
Let's build a custom player version where we have the RTMP plugin built in plus our netConnectionUrl preconfigured in the SWF. Additionally we will compile the controlbar plugin into the player, and finally we'll customize the play button overlay label at the end of the video to be "Replay".
With all this our BuiltInConfig.as looks like this:
package {
import org.flowplayer.rtmp.RTMPStreamProvider;
import org.flowplayer.controls.Controls;
public class BuiltInConfig {
private var rtmp:org.flowplayer.rtmp.RTMPStreamProvider;
private var controls:org.flowplayer.controls.Controls;
public static const config:Object = {
plugins:{
controls: {
url: "org.flowplayer.controls.Controls"
},
rtmp: {
url: "org.flowplayer.rtmp.RTMPStreamProvider",
netConnectionUrl: 'rtmp://cyzy7r959.rtmphost.com/flowplayer'
}
},
play: {
replayLabel: 'Replay'
}
}
}
}
As you an see we have the controls and the rtmp plugins defined. Their URLs point to the main classes of the plugins. These URLs are all visible (commented out) in the Subversion trunk version of the file. Finally we have the play object defining the custom replay label to be used in our custom player.
For this to work we need to have the controlbar and RTMP plugins available in our workspace directory. Please refer here to see how to set that up. Finally to finish the compilation settings we need to edit the flowplayer/build.properties file. Specifically we need to set correct values for the plugin-classes, and controls-dir properties:
# the ActionScript source folders for all plugins that we are building into the player
plugin-classes=../controls/src/actionscript ../rtmp/src/actionscript
# if building in the controls plugin, the following must point to the root folder of the plugin
controls-dir=../controls
At this point we are ready to compile our custom player. To do this we execute ant in the flowplayer directory like this:
[api@flowmac:core]$ ant
If the compilation is successfull your custom player will be placed in the build directory. The default Flowplayer controlbar skin will be used. If you want to build with the "tube" skin run this command:
[api@flowmac:core]$ ant -Dcontrols=tube
To build the commercial version run
[api@flowmac:core]$ ant build-biz
That's all for now. If you need help, you can ask questions in our user forum.