Ooyala Player Token View (Deprecated)

The information in this page applies to the deprecated Player V3. For more up-to-date information about Ooyala Player Token, see Ooyala Player Token for Player V4.
Important: Ooyala Player V3 is deprecated and is scheduled to be disabled on 2018-01-31. After that date, Player V3 will no longer play your video or audio content. Customers still using Player V3 need to migrate to Player V4 (see Migrating from Player V3 and Player Migration FAQ).

You can use the following code sample to understand how to add token authentication to a player experience. (Token authentication as shown in this example is available only if your Ooyala account includes Ooyala Player Token. To enable this functionality, contact your account manager.)

The code sample includes multiple client web pages or views illustrating each feature and a seventh code sample that shows all the features working in combination. To implement each client page, you will need all the standard elements that you normally use, such as your API Key and pcode (for details, see Your API Credentials), and so forth.

Where to Find the Code

To explore this code sample view in GitHub, go tohttps://github.com/ooyala/code-samples/blob/master/application/views/Secure_XDR_GoogleIMA/token.php.

Ooyala Player Token Client Code

The token.php file implements Ooyala Player Token authentication content protection. In this Player Token sample, we use the following Player V3 APIs and parameters.

  • OO.ready() - This function indicates that the script has loaded, initialized completely, and that the player is ready for playback.
  • OO.Player.create() - This function creates a new message bus, creates any registered modules, and connects registered modules to the message bus. In the sample, you should note that OO.Player.create is used with embedToken in the hash with the embed token url as part of the key value pair.
  • platform - This parameter is used to control selection of HTML5 or Flash playback. In the sample, it is set to Flash as the priority choice for playback.
Note: Before using the token in your code, review all of the Ooyala Player Token documentation.

Implementing the Player Token Sample

To implement the sample, we do the following:
  1. Manually set the Require Ooyala Player Token checkbox in Backlot. See “Setting the Ooyala Player Token.”
  2. Craft an authorization request using the URL token request template. See Ooyala Player Token for Player V3 (Deprecated).
  3. Create the trigger to request authorization and a token from the Ooyala authorization server, using the token request. See Complete Web Example: Authorize Playback and Obtain a Token.
  4. Generate a computed signature. You need to generate signature using an http method. You can use the PHP SDK or Ruby SDK to do this. The included PHP SDK has a mechanism to generate the signature needed by the Ooyala Player Token. (See Ooyala Player Token for Player V3 (Deprecated)). When you generate the signature, you will have two parameters:
    • a query parameter and
    • an HTTP method. For the Ooyala Player Token, you need to use a GET request for the http method.
  5. Assemble the request and concatenate the results.

Was this article helpful?