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: 

hot to pass referer to amazon s3 in brightscript

I have created a roku private channel for my website which succesfully uses amazon S3 to host video files. I was able to get the roku player to play the vidoe from amazon S3 but only by making the video readable by the public when normally I have a bucket policy that only allows you to view the video if the referer header in the HTTP request comes from my website.

I would like to have some help modifying the brigthscript so that it passes the referrer header to Amazon S3 correctly with my site so that it will allow the video to play without having to turn on read for anyone in my S3 bucket.

Any help on this would be greatly appreciated.

I am using a modified version of the example videoplayer scripts for my site and having good luck with everything so far.

I have tried the below already with good results

urlUtils.brs: obj.AddHeader("Content-Type", "application/x-www-form-urlencoded")

added another line for obj.AddHeader("Referer", "http://etc....")

Found to places where AddHeader was used and tried both spots in the urlUtils.brs script and recompiled and re-tested without any good results. As soon as I made the file read globally it plays but I can't get the header to send to Amazon S3 so that it knows to allow it to play from my bucket policy like I have working for my web site.

Thanks
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.