Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Sove
Channel Surfer

Widevine DRM is not working

Hi!

I'm trying to activate widevine drm in the player as it says in the documentation (https://developer.roku.com/docs/specs/media/content-protection.md), but it still doesn't work. I have also added the lines to the manifest.

 

The code:

 

if streaming.licenseUrl <> invalid
        drmParams = {
            licenseServerURL: streaming.licenseUrl.widevine
            keySystem: "Widevine"
        }
        m.child[0].drmParams = drmParams
    end if
    if streaming.url <> invalid
        m.child[0].url = streaming.url

        node = CreateObject("roSGNode", "ContentNode")
        node.Update({children: m.child}, true)

        m.videoPlayer.content = node
        m.videoPlayer.enableUI = false
        m.videoPlayer.contentIsPlaylist = true

        m.videoPlayer.control = "play"
        m.videoPlayer.ObserveField("state", "OnVideoPlayerStateChange")
        m.videoPlayer.ObserveField("visible", "OnVideoVisibleChange")
    else
        errorPlayContent()
    end if

I am doing something wrong? Or am I missing something to add?

0 Kudos
2 REPLIES 2
vijay-desh
Channel Surfer

Re: Widevine DRM is not working

@Sove  Can you add http headers for the same some its no working directly.

 

https://developer.roku.com/docs/references/brightscript/interfaces/ifhttpagent.md

0 Kudos
Sove
Channel Surfer

Re: Widevine DRM is not working

Including httpAgent it doesn't work...

if streaming.licenseUrl <> invalid
        drmParams = {
            licenseServerURL: streaming.licenseUrl.widevine
            keySystem: "Widevine"
        }
        m.child[0].drmParams = drmParams
    end if
    if streaming.url <> invalid
        m.child[0].url = streaming.url

        device = CreateObject("roDeviceInfo")
        httpAgent = CreateObject("roHttpAgent")
        if httpAgent <> invalid then
            httpAgent.SetCertificatesFile("common:/certs/ca-bundle.crt")
            httpAgent.InitClientCertificates()
            httpAgent.EnableCookies()
            httpAgent.AddHeader("X-Roku-Reserved-Dev-Id", "")
            m.VideoPlayer.setHttpAgent(httpAgent)
        else
            headers = []
            headers.push("X-Roku-Reserved-Dev-Id:")
            m.child[0].HttpHeaders = headers
            m.child[0].HttpSendClientCertificates = true
            m.child[0].HttpCertificatesFile = "common:/certs/ca-bundle.crt"
            m.VideoPlayer.EnableCookies()
            m.VideoPlayer.SetCertificatesFile("common:/certs/ca-bundle.crt")
            m.VideoPlayer.InitClientCertificates()
        end if

        m.videoPlayer.content = m.child[0]
        m.videoPlayer.enableUI = false
        m.videoPlayer.contentIsPlaylist = true

        m.videoPlayer.control = "play"
        m.videoPlayer.ObserveField("state", "OnVideoPlayerStateChange")
        m.videoPlayer.ObserveField("visible", "OnVideoVisibleChange")
    else
        errorPlayContent()
    end if
0 Kudos