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: 
AeroJack
Visitor

Response headers with a roVideoScreen

I have a HLS stream that I am trying to play with a roVideoScreen object. With the request for the m3u8, the server sets a cookie that it wants sent back when the individual streams are accessed. I know that the Roku does not support cookies, but if I can read the response header than I can add the correct header. But, I cannot seem to access the response headers with the VideoScreen object.

Can any point me in the right direction?
0 Kudos
4 REPLIES 4
retrotom
Visitor

Re: Response headers with a roVideoScreen

Would it make more sense to just have a web page/service that returns the "session" information and then use that session identifier in subsequent requests? So could you just have a page/script like "http://www.example.com/getSessionInfo.php?contentID=blah" and have that write out the session "cookie" information in xml? And then once that XML session info is parsed, use all the values in your request for the video -- like "http://www.example.com/videoStream.php?contentID=blah&sessionID=blah".
0 Kudos
AeroJack
Visitor

Re: Response headers with a roVideoScreen

Don't have control over how the server works, just trying to play the stream that comes from it.

My current thinking now is find a way to get the cookie that needs to be set from using a roURLTransfer and then passing the m3u8 playlist to a videoScreen and having it play the segments without downloading the playlist again.
0 Kudos
TomCorwine
Channel Surfer

Re: Response headers with a roVideoScreen

You could just do a HEAD request using roURLTransfer and grab the cookie that way. Then use roVideoScreen in the usual way, except use AddHeader() to send the cookie. Assuming, of course, the server permits HEAD requests.
0 Kudos
RokuKevin
Visitor

Re: Response headers with a roVideoScreen

You can send cookies via the "Cookie" header.

Example:

cookie = "The cookie you'd like to send"
port = createObject("roMessagePort")
screen = createObject("roVideoScreen")
screen.setMessagePort(port)
screen.AddHeader("Cookie", cookie)
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.