PlayReady Example

A PlayReady reference implementation shows example code needed to implement and initialize PlayReady content protection.

To assist you in creating the code for PlayReady DRM, Ooyala provides a reference implementation in a zip file that contains sample code in Silverlight. The sample contained in the file demonstrates one way of making a license request. You can get the file from your account manger. When creating the code necessary to make the appropriate authorization requests, at a high-level, you need to:
  • Make an authorization request to Ooyala (see step 3 in the PlayReady Workflow table).

  • Parse the stream url and auth_token from the auth_response.

  • Insert the auth_token into the PlayReady license request and then play the smooth stream (see step 5 in the previous PlayReady Workflow table).

Anatomy of an Authorization Token

In step 3 of the PlayReady Workflow, an authorization request is made. When this authorization request includes a valid Ooyala Player Token, the response will include an auth_token. This authorization token will look something like the following:

{"authorization_data"=> ...,
"auth_token" => "foo",
"signature"=> ...


The auth_token needs to be included in the PlayReady license request as indicated in step 5 of the PlayReady Workflow.

Using the Smooth Stream Client SDK

You can use PlayReady with the Smooth Stream Client SDK, which you can download at ( A sample is available from your Customer Success Manager that illustrates how to use the IIS (Smooth Stream Client SDK) to playback smooth streams and make the license request. The following excerpt from the sample (written in C#), shows:

  • how the stream url is obtained from the authorization request.
  • when the authorization response contains the auth_token, how to insert the auth_token into the license request.
// Make an authorization request first, then get the manifest and auth token from the response.
           WebClient client = new WebClient();
           client.DownloadStringCompleted += (target, eventData) =>
                   OutputText.Text += "Authorization response received\n";
                   JsonObject response = (JsonObject)JsonObject.Load(new StringReader(eventData.Result));

// The stream url is obtained from the authz response.
                   Byte[] streamUrlArray = Convert.FromBase64String(((JsonObject)
                   String streamUrl = Encoding.UTF8.GetString(streamUrlArray, 0, streamUrlArray.Length);

// If the authz response includes an auth token, insert it into the license request.
                           = "auth_token=" + response["auth_token"];
                   SmoothPlayer.AutoPlay = true;
                   SmoothPlayer.SmoothStreamingSource = new Uri(streamUrl);
               catch (Exception exception)
                   OutputText.Text += "Error: " + exception.ToString() + "\n";

// For the purpose of this sample, the authorization url is set by the user. See Authorization API docs for how to
// construct the Authorization request, and Ooyala Player Tokens.
           OutputText.Text += "Making authorization Request\n";
           client.DownloadStringAsync(new Uri(UrlText.Text));

Using Other Client Libraries

For other types of client libraries the auth_token must be included in the license request as CustomData in the: '/soap:Envelop/soap:Body/AquireLicense/challenge/Challenge/LA/CustomData' The following example show how to include the auth_token in the license request for other client libraries:

<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
    <AcquireLicense xmlns="">
       <Challenge xmlns="">
         <LA xmlns="" Id="SignedData" xml:space="preserve">