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! :disappointed_face:

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.

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.

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()

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

For video playing I have implemented CloudFront Signed Cookies n a Roku its will be work on Brightscript Simulator ?

The BrightScript Simulator is a project created by an independent developer and isn’t maintained by Roku. You’d need to contact the maintainer to find out if this works.

Any Simulator which as maintained by Roku ?

Roku had announced the Roku Cloud Emulator last fall at the Developer Summit, a hosted version of Roku OS that you can get to through a web browser, but it is not yet available for public use.

Ok, Thank You for response and I think now check on Real Roku devices is one of option