This page explains how to compile plugins using the Adobe Flex SDK. With a combination of this free-for-download tool and a text editor of choice, anyone can build plugins for the JW Player. The Flex SDK is available for Linux, Mac OS X and Windows. The various open-source plugins that we offer for download can also be modified and re-compiled using this tool.
Note: If you're looking to develop a plugin in order to serve ads in the JW Player, please contact us beforehand. We have a special SDK for advertisers and advertising networks.
The Flex SDK can be downloaded for free from the Adobe site. The checkboxes and questions on this page are just for Adobe marketing purposes; they won't change the download.
When the download has been completed, unzip the file and place the flex_sdk_3 folder in your folder of choice (e.g. Program Files on Windows or Applications on the MAC). No more installation is needed.
Now let's test-compile a plugin. You can get a few basic plugins by downloading the free Plugin SDK. Inside this Plugin SDK, you will find the source code of a few plugins. Each plugin source includes both a build.bat and a build.sh file. The first will compile the plugin on Windows, the latter will compile the plugin on Linux and Mac OS X.
To compile plugins, you'll also need jwplayer-5-lib.swc (the library which contains the Flash Plugin API). It's included in the plugin SDK, but if you're compiling your plugin without using the SDK, you'll have to download it separately and include it in your MXMLC library path.
The build.bat file is used when you run Windows. Open the file in a text editor to check (and possibly change) the path to the Flex SDK on your computer. By default, it is \Program Files\flex_sdk_3. If the path is OK, you can double-click the build.bat file to compile the plugin. That's all!
The build.sh file is used when you run Linux or Mac OS X. Open the file in a text editor to check (and possibly change) the path to the Flex SDK on your computer. By default, it is /Developer/SDKs/flex_sdk_3. If the path is OK, you can open a Terminal window and insert the full path to the build.sh script to run it. Since sometimes the permissions of this build.sh file are not sufficient to run it, here is an example of what to insert in the terminal window to also set the permissions right:
cd ~/Desktop/sdks/fl5-plugin-sdk/plugins/player5plugin chmod 777 build.sh ./build.sh
That's it! Your plugin will now be built.
Note that the compiler will automatically stop and display compilation errors, should there be any in your source code. Use these error messages to find and fix the bugs.
As you may have seen when opening build.bat or build.sh in the text editor, the actual compilation command is just one line of code:
%FLEXPATH%\bin\mxmlc .\Positioning.as -sp .\ -o .\positioning.swf -library-path+=.\lib -load-externs .\lib\jwplayer-5-classes.xml -use-network=false
This command tells mxmlc (the compiler executive) which actionscript file to compile (Positioning.as). This file is the main class of the plugin. When the plugin is loaded into a player, this main class will be instantiated once. Next to the class to build, the compiler is also given a few options:
The options listed above are sufficient to compile working plugins. The compiler supports a large number of options though, most of them are for more advanced compilation workflows or metadata insertion.
As with the 4.x player, compiling plugins using Flash Professional CS4 or CS5 is still supported. Here's what you'll need to do to compile your plugin in Flash CS4/CS5:
Your pugin swf should appear in the same location as your FLA file.
If you have built your own plugin and are happy happy with the way it works, you can submit it to LongTail Video. We'll do a quick sanity check of your plugin and then list it in our addons section. You can also ask for donations of your plugin through our site to make some money. For more info about that, please contact us.