Building JWPlayer v6.12 from Source (for the rest of us)

Building JWPlayer v6.12 from Source with an Embedded RTMPE Secret Key for use with Protected Wowza Server (for the rest of us)

Last Updated: 04/29/2015

Used to rebuild the current version of the player with an embedded secret code for use with the Wowza RTMPE stream security protocol. Must be built on a machine that can run old 32-bit versions of Java specifically the 1.5 JDK (this rules out OS X after Mavericks as Apple does not support it).

Build Machine Setup

Requirements

  • 32-bit Windows XP/7/8.1
  • 32-bit Java 1.5
  • Ant 1.7.0
  • Adobe Flex SDK 4.5.1

Installing Java 1.5

URL: http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html

  1. Set the JAVA_HOME environment variable to the installation location of Java JDK root folder (usually C:\Program Files\Java\jdk1.5.0_22)
  2. Add the bin directory of the Java JDK to your system’s PATH environment variable by referencing the JAVA_HOME environment variable, this makes it so there is only one place that the Java JDK path needs to updated (%JAVA_HOME%\bin)
  3. Close all Command Prompt windows if any are open as they will not have the changes to the path you made until reopened
  4. Verify the system is now using Java 1.5 by opening a clean Command Prompt and executing the command java -version

Installing Apache Ant 1.7.0 (open build platform used in the Java world)

URL: http://archive.apache.org/dist/ant/binaries/

  1. Download the binary zip and extract it
  2. Copy the extracted folder to the C drive (C:\apache-ant-1.7.0)
  3. Add the Ant bin folder to the Windows PATH environment variable (C:\apache-ant-1.7.0\bin)
  4. Close all Command Prompt windows if any are open as they will not have the changes to the path you made until reopened
  5. Verify the system is now using Ant 1.7 by opening a clean Command Prompt and executing the command:

ant -version

Installing Flex SDK 4.5.1

URL: http://sourceforge.net/adobe/flexsdk/wiki/Download%20Flex%204.5/

  1. Create a new folder in the C drive called JWPlayer (C:\JWPlayer)
  2. Download the SDK zip archive and extract the contents to the JWPlayer folder (C:\JWPlayer\flex_sdk_4.5.1.21328A)

Installing the JWPlayer Source

URL: https://github.com/jwplayer/jwplayer/tree/release

  1. Download the 6.12 release of the JWPlayer source code (at this time it is the current release and is therefore in the release branch on GitHub, this will change as new releases come out)
  2. Extract the archive to the JWPlayer folder you created early (C:\JWPlayer\jwplayer-release-6.12)

Building the Player from Source

Update Build Properties

  1. Open the build.properties file located in the JWPlayer source folder you just extracted (C:\JWPlayer\jwplayer-release-6.12\build\build.properties)
  2. On line 11 change the ‘flexsdk’ key with the location of the Flex SDK, you must use Unix style file path (flexsdk = C:/JWPlayer/flex_sdk_4.5.1.21328A)
  3. On line 16 change the ‘execextension’ key with a ‘.exe’ as we are using Windows to build (execextension = .exe)
  4. Save and close the file

Update Player Version

  1. Open the PlayerVersion.as file (C:\JWPlayer\jwplayer-release-6.12\src\flash\com\longtailvideo\jwplayer\player\PlayerVersion.as)
  2. On line 5 change the value “JWPLAYER::version” to “6.12.0”

Adding the Secret Key

  1. Open the RTMPMediaProvider.as file (C:\JWPlayer\jwplayer-release-6.12\src\flash\com\longtailvideo\jwplayer\media\RTMPMediaProvider.as)
  2. On line 491 change var hash:String = TEA.decrypt(evt.info.secureToken, getConfigProperty(‘securetoken’)); to var hash:String = TEA.decrypt(evt.info.secureToken, “VALUE_OF_NEW_SECRET_KEY_GOES_HERE”);

Building

  1. Open a Command Prompt at the root of the JWPlayer’s source folder (C:\JWPlayer\jwplayer-release-6.12)
  2. Execute the command

ant -buildfile build\build.xml

Troubleshooting

So many different things can go wrong, way too many to list in this document, Google is a great resource 😉

Release Binaries

New player should be located in bin-release if the build was successful
Assets Created jwplayer.js, jwplayer.html5.js, jwplayer.flash.swf

Notes:

Adding a JAVA_HOME environment variable to your system and adding Java to your PATH by referencing JAVA_HOME, instructions can be found here https://kaanmutlu.wordpress.com/2013/04/26/setting-the-java_home-in-windows-7-64-bit/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s