Forum Discussion

gomad's avatar
gomad
Roku Guru
7 years ago

video node setting header is not working

Hi,
I have a stream with widevine drm, i am doing the following (pseudo code):
drmParams = {
"keySystem": "widevine",
"licenseServerURL": "https://mylicenseserver.net"
}
ContentNode_object.streamformat = "dash"
ContentNode_object.url = "https://mydashmanifest.mpd?asdas"

'setting header and drm params
ContentNode_object.HttpHeaders = ["mydata:licensekey"]
ContentNode_object.drmParams = drmParams
m.video.content = ContentNode_object


I get the following error:
inside video state: error
inside video errorCode: -6
inside video errorMsg: ignored

I see that the license server is not getting the headers.
Any ideas?
regards,
Gokul M
  • coldrain's avatar
    coldrain
    Binge Watcher
    You need to call m.video.AddHeader("headername", "header value") instead
  • this is what worked for me:
    hvideo = CreateObject("roHttpAgent")
    vheaders = {"h1":"value"}
    hvideo.SetHeaders(vheaders)

    and before setting the content
    m.video.setHttpAgent(hvideo) ' settting headers
    • Hi gomad, 

      I have implemented like as yours . but i am still not able to play with DRM encrypted content. 

      can you help me out where i am stuck.

      following are the errors i am getting:

      m.video.errorMsg: Protected content license error.
      m.video.errorStr: decoder: pump: DRM exception: decrypt error: DRM failed:extra:clip_id: 0

       

      following are the code for it:

      vidContent = CreateObject("RoSGNode", "ContentNode")

      drmParams = {
      keySystem: "Widevine"
      }
       
      vidContent.streamformat = "dash"
      vidContent.drmParams = drmParams
       

      httpAgent = CreateObject("roHttpAgent")
      httpAgent.SetCertificatesFile("common:/certs/ca-bundle.crt")
      httpAgent.InitClientCertificates()
      httpAgent.EnableCookies()
      httpAgent.AddHeader("X-Roku-Reserved-Dev-Id", "")
      headers={
      "customdata":"PD94bWwgdmVyc2lvbj0....."    ' 64 bit encoded key string passing in header
      }
       
      httpAgent.setheaders(headers)
      m.video.enableUI = false
      vidContent.live=true
      m.video.content = vidContent
      m.video.setFocus(true)
      m.video.control = "play"
      • srAkhil7's avatar
        srAkhil7
        Reel Rookie

        You could simply do that by setting
        videoNode.httpHeaders = headersKeyValueMapObject

        These headers are passed in requests made by the player.


        If you want custom headers only to be passed in the DRM request, the new drmHttpAgent available from. 9.3 will do the purpose.