The light-weight Flash video player that makes Flash work like HTML5 video. This allows player skins, plugins, and other features to work with both HTML5 and Flash
This project doesn't need to be used if you simply want to use the Flash video player. Head back to the main Video.js project if that's all you need, as the compiled SWF is checked in there.
-
Go through the Getting started section for Video.js. Most importantly, you will need have already built video.js successfully before building video-js-swf.
-
Install Apache Flex. There's no need to install any of the optional items.
-
In the base directory of video-js-swf, you'll see a setup.sh script. Make sure to include the path to Video.js and Flex SDK as arguments to the script.
./setup.sh [video_js_dir] [flex_sdk_dir]
This script will do the following:
- Create a new directory in your Flex SDK for playerglobal10_3.swc, and download this file.
- Set up the bin-debug and bin-release directories. .
-
Install a simple HTTP server for simpler testing.
npm -g install simple-http-server
-
Build video-js.swf using build.sh. Make sure to include the path to the Flex SDK as an argument to the script.
./build.sh [video_js_dir] [flex_sdk_dir]
This script will do the following:
- Compile the source into bin-release using the release compiler settings.
- Copy the SWF into [video.js]/src/swf/video-js.swf
-
Start running the simple HTTP server from the command-line.
nserver
Now you can see the demo working with your newly-built code: Start the simple HTTP server in the video-js-swf root directory, and open your browser at [https://localhost:8000/bin-release/demo.html]
You can keep using build.sh to rebuild the Flash code.
The bin-debug directory is set up for usage with your IDE
If you don't want to keep using build.sh to build the code, the bin-debug directory is set up for use with your IDE. It is similar to the bin-release directory, except that the SWF name is expected to be VideoJS.swf. This works better with some IDEs that expect the SWF name to be the same as the main class name.
You can also use the given .actionscriptProperties with Flash Builder. It is set up to use bin-debug and generally ready to use. When you want to run the project, set the output URL to https://localhost:8000/bin-release/demo.html. As long as nserver is running, you should get the latest code you compile there.
This project uses FlexUnit which is built into Adobe FlashBuilder and is also available on GitHub if you are only interested in the binaries.
The unit tests can be found in [project root]/src/com/videojs/test/
In order to run the tests:
./test.sh
A copy of the produced swf will also be compiled into the bin-debug folder.