Check out the JW Player Secure Token Tutorial

Posted by Derrick on December 27, 2010 under Video Streaming and Compression | Be the First to Comment

Check out the JW Player 5.2 Secure Token Tutorial. This is a great tutorial for those that need to get familiar with how to implement secure token in JW Player for use with Wowza Media Server. You’ll find a reference for installing Flex as well as a hands-on tutorial to guide you through the secure token set-up in JW Player 5.2

Creating a Secure Token SWF for JW Player 5.2

Posted by Derrick217 on August 15, 2010 under Video Streaming and Compression | Be the First to Comment

Creating a Secure Token .SWF for JW Player 5.2 is a process that many delivering secure streaming video content will need to perform. Wowza Media Server 2 supports Secure Token streaming with JW Player 5.2 for video playback. To get this going you must first set up your Secure Token application and have it running on Wowza Media Server 2.  To create a JW Player 5.2 .SWF file that has Secure Token you must first have Flash Professional CS5 and Flex SDK installed. Here are some notes for installing the Flex SDK.

In this tutorial you’ll learn how to create a .SWF file that has your desired Secure Token value using Flash Professional CS5. (Technically you’ll also be using the Flex SDK as well.).  First make sure you download the source code for JW Player 5.2 from trunk from the link below:

http://developer.longtailvideo.com/trac/browser/trunk/fl5

Note: This tutorial is for compiling with the non-commercial JW Player 5.2 license.

Let’s get started with the tutorial.  In Flash Professional CS5 navigate to the File Pull-down menu and choose New to create a new .FLA document.

When the dialog appears select ActionScript 3.0.

Next, you need to save your new document by navigating to the File Menu and choosing Save.

Name your new .FLA file securetoken_sample.fla and save it to the trunk\fl5\src folder within trunk on your computer.

Within your securetoken_sample.fla file move to the Properties Tab and input com.longtailvideo.jwplayer.player.Player into the Class Text box under Publish.

Now, choose Preferences from the File Pull-down menu.

Click on the ActionScript Category

and select the ActionScript 3.0 Settings button

When the Dialog opens, in the Flex SDK Path Text box enter the path to your Flex SDK.

Next, choose Publish Settings from under the File Pull-down menu.

When the Dialog opens choose the Flash tab and click the Settings button next to the Script Drop-down menu where ActionScript 3.0 appears.

Under the Library path tab, edit the entry for $(FlexSDK)/frameworks/libs/flex.swc to read $(FlexSDK)/frameworks/libs by removing flex.swc.  After you make the changes choose OK.

That’s all you need to do to set things up in your securetoken_sample.fla.

You can now open the RTMPMediaProvider.as file within \trunk\fl5\src\com\longtailvideo\jwplayer\media. Next, you’re going to add your Secure Token value that matches the value you have in your Secure Token application on Wowza Media Server 2.

Once you have your RTMPMediaProvider.as file open scroll down approximately to Line 462 and change the following information in your file:

from this:

_connection.call(“secureTokenResponse”, null, TEA.decrypt(evt.info.secureToken, config.token));

to this:
_connection.call(“secureTokenResponse”, null, TEA.decrypt(evt.info.secureToken, “#sa%m0#p@7″));

If you’re following along with the Wowza Media Systems’ tutorial use the default secure token value that they’ve supplied and change your RTMPMediaProvider.as file

to display this:

_connection.call(“secureTokenResponse”, null, TEA.decrypt(evt.info.secureToken, “#ed%h0#w@1″));

After you apply your settings you can save your RTMPMediaProvider.as file and close it.

Finally, you can go back to your securetoken_sample.fla file to export out a new .SWF.  In Flash Professional CS5 navigate to the File pull-down menu and choose Export Movie from the Export Sub-menu.

Save your file in the src folder you saved your securetoken_sample.fla file in earlier and name the new .SWF file securetoken_sample.swf and choose Save.  Congratulations! Now you can take your new .SWF file with Secure Token and use it for authoring your web pages with JW Player 5.2.

Notes for Installing Flex SDK 3

Posted by Derrick on August 14, 2010 under Video Streaming and Compression | Be the First to Comment

Here are some notes for Installing Flex SDK 3.  One of the steps for compiling a .SWF file with Secure Token and JW Player 5.2 requires that you install Flex SDK 3.  The process for creating a .SWF with Secure Token and JW Player 4 was much easier but now with version 5 there are some additional steps involved, one of which is installing Flex SDK 3. Here’s the tutorial: Creating a Secure Token SWF for JW Player 5.2 once you’ve installed the Flex SDK.

Flex SDK 3 Download

Flex SDK 3.3: http://opensource.adobe.com/wiki/display/flexsdk/Downloads

Below is a link with instructions for installing Flex SDK 3 ( You can use the Flex 4 SDK instructions)

http://www.adobe.com/support/documentation/en/flex/4/releasenotes_flex4_sdk.html

Uninstall Current Flash Player

You should use Flex SDK with the latest version of the debug Flash Player 10. Prior to installing the Flex SDK, you should uninstall your current Flash Player.

Uninstaller links are here:

http://kb2.adobe.com/cps/141/tn_14157.html

Install the Flex SDK

1.    Download Flex SDK ZIP file from the Adobe website or the Adobe Open Source site.

2.    Create a directory to contain Flex SDK

3.    Extract the Flex SDK ZIP file to this directory. The Flex SDK contains the following directories:

/ant — Contains Flex Ant Tasks.
/asdoc — Contains helper files for the ASDoc tool that creates HTML documentation
from your MXML and ActionScript source code.
/bin — Contains the mxmlc, compc, asdoc, and fdb utilities. The bin directory also
contains the jvm.config file, which specifies Java settings that you can modify, if
necessary.
/frameworks — Contains compiled framework classes, configuration files, and
framework source code.
/lib — Contains JAR files used by the utilities.
/runtimes — Contains installers for the Adobe AIR runtime inside the air directory and
installers for debug versions of Flash Player 9 inside the player directory.
/samples — Contains sample applications.
/templates — Contains HTML templates for Flash Player detection and browser
integration and inside the air folder, a sample Adobe AIR application.xml file.

4.    Ensure that the Java Runtime Environment (JRE) is installed on the computer and that the java_home/bin directory is defined in the system path. JRE 1.5, or 1.6 is required.

5.    Install the appropriate debug Flash Player from the install_root/runtimes/player/platform directory.

6.    (Optional) When the Flash Player installation finishes, restart your computer to ensure that the updated Flash Player browser plug-in is enabled.