This is a message.

Custom Flowplayer builds

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.

Initial setup

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.

You can include a full Flowplayer configuration object hardwired in the Flowplayer SWF. This configuration object can hold all of the common configuration you use in your website. You can override the built-in configuration options in the configuration object that you supply to the player when you embed it in your pages. You can also add more options when embedding - in fact you don’t need to compile any options in if you supply everything when embedding the player.

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 Github contains the standard Flowplayer plugins all commented out.

Preparing your custom player

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'
}
}
}
}

ActionScript 3

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.

Note that you can include a different replayLabel in the configuration that you supply when embedding the player - this will override the value that has been built into the custom player. This is a way to override the hardwired setting you have compiled into the custom player in case you need it to behave differently in some specific case.

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

Properties

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

Bash

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

Bash

To build the commercial version run

[api@flowmac:core]$ ant build-biz

Bash

That's all for now. If you need help, you can ask questions in our user forum.