Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
paul_striker
Level 7

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! Smiley Sad

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
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
Level 7

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