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: 
gomad
Roku Guru

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
0 Kudos
4 REPLIES 4
coldrain
Binge Watcher

Re: video node setting header is not working

You need to call m.video.AddHeader("headername", "header value") instead
0 Kudos
gomad
Roku Guru

Re: video node setting header is not working

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
0 Kudos

Re: video node setting header is not working

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"
0 Kudos
srAkhil7
Reel Rookie

Re: video node setting header is not working

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.

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.