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: 
paul_striker
Reel Rookie

Roku video player with AWS CloudFront Signed cookies

I'm using AWS CloudFront as CDN to host my videos (HLS i.e., .m3u8) and using signed cookies to authenticate. Three set of cookies need to be set to the request header, CloudFront-Policy, CloudFront-Signature and CloudFront-Key-Pair-Id in order to retrive the .m3u8 file from CloudFront. I tried the following:

 

httpAgent = CreateObject("roHttpAgent")
cookies = [
{ Name: "CloudFront-Policy", Value: "val", Path: "/", Domain: "domain.com" },
{ Name: "CloudFront-Signature", Value: "val", Path: "/", Domain: "domain.com"},
{ Name: "CloudFront-Key-Pair-Id", Value: "val", Path: "/", Domain: "domain.com"}
]
httpAgent.EnableCookies()
httpAgent.AddCookies(cookies)

m.videoPlayer.setHttpAgent(httpAgent)

and 

 

httpAgent.AddHeader("Cookie", "CloudFront-Policy=" + val1 + "; " + "CloudFront-Signature=" + val2 + "; " + "CloudFront-Key-Pair-Id=" + val3)

But none helped! 😞

Even, I tried using the Roku Stream/RAF Tester but unfortunately I have TelstraTV device which didn't allow me to link with the Roku developer account.

 

 

0 Kudos
3 REPLIES 3
roAmanda
Roku Employee
Roku Employee

Re: Roku video player with AWS CloudFront Signed cookies

We recommend purchasing a retail Roku device for channel development testing. You can find them on eBay.

You need to be initiating secure sockets on this object. We don't see that part of your code.

paul_striker
Reel Rookie

Re: Roku video player with AWS CloudFront Signed cookies

Thank you for the reply.

But I coundn't understand why I have to initiate secure sockets? Do you mean secure https?

httpAgent.SetCertificatesFile("common:/certs/ca-bundle.crt")
httpAgent.InitClientCertificates()
0 Kudos
RokuDavid
Roku Employee
Roku Employee

Re: Roku video player with AWS CloudFront Signed cookies

Yes, you are correct - https. Let us know if that doesn't work.

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.