Forum Discussion

johnmarsden's avatar
9 years ago

How to use PlayReady DRM on the older SDK (not SceneGraph)?

I will be doing a SceneGraph application soon, but I need to implement PlayReady into something soon on my current app. I was looking at the documentation but it seems to show a SceneGraph example:


contentNode = createObject("roSGNode", "contentNode")
contentNode.streamFormat = "smooth"
contentNode.url = "wwww.myvideo.com/content.ism"
contentNode.drmParams = drmParams

m.video.content = contentNode



Is there an example out there for how I implement the same thing but for non-SceneGraph applications? Something that uses the standard (soon-to-be deprecated) video player?

Thanks!

7 Replies

  • Correct. Yeah, I guess what I need in this metadata are these two key/vals:


    EncodingType = "PlayReadyLicenseAcquisitionAndChallenge"
    EncodingKey = "PlayReadyLicenseServerUrl" + "%%%" + customData"



    And adding those two to the ContentMetaData object of every video should essentially be the same thing as the SceneGraph example?
  • Hey @RokuNB,

    I tried setting this up today but I'm not seeing any calls go out to the DRM server. No traffic seems to be sent from the Roku side. I'm setting the EncodingType on the Content Meta-Data to be "PlayReadyLicenseAcquisitionAndChallenge" and the encoding key to be "URL%%%data"

    So the encoding key looks something like this: 
    https://lic.drmtoday.com/license-proxy-headerauth/drmtoday/RightsManager.asmx%%%eyJtZXJjaGFudCI6Im15LW1lcmNoYW50Iiwic2Vzc2lvbklkIjoibXktc2Vzc2lvbi1pZC1oZXJlIiwidXNlcklkIjoiMTIzNDUifQ==


    Which translates to this (with proper values changed for server):

    {
        "merchant": "my-merchant",
        "sessionId": "my-session-id-here",
        "userId": "12345"
    }


    And the URL is obviously: https://lic.drmtoday.com/license-proxy-headerauth/drmtoday/RightsManager.asmx

    Are you seeing anything wrong here that would prevent the data from being sent up to the server? Is there a flag I need to enable aside from these two key values on the Content Meta-data object?


    Edit: 
    Not sure if this matters, but my `getDRMInfo` call on roDeviceInfo reports back this:


    <Component: roAssociativeArray> =
    {
        PlayReady: " "
    }


    Which doesn't say anything about "tee;ss" as per https://sdkdocs.roku.com/display/sdkdoc/ifDeviceInfo . Not sure if that is affecting this. I've also tried explicitly setting some certificate data on the roVideoScreen like this:

                ' set https certs
                m.screen.setCertificatesFile("common:/certs/ca-bundle.crt")
                m.screen.setCertificatesDepth(4)
  • Have you figured this out yet?

    I am in the same boat.  I think I have everything right but I don't get playback.  No errors and I see nothing on the Castlabs side of things.

    Nathan
  • "johnmarsden" wrote:
    Nope, no answers yet.

    Sadly i know nothing on this. Two random things, for me:
    Brightscript Debugger> ? createObject("roDeviceInfo").getDrmInfo()
    <Component: roAssociativeArray> =
    {
    PlayReady: "tee"
    }

    And also if you setCertificatesFile(), you should follow it with InitClientCertificates().
  • Did You set up video URL in a proper way?
    Wrong code:
    videoclip = CreateObject("roAssociativeArray")
    videoclip.url= URL

    Proper way to set up URL in the old SDK for the stream would be:
    videoclip = CreateObject("roAssociativeArray")
    videoclip.StreamUrls = [URL]

    ***I know this is an old thread but maybe I will help someone else.