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

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

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

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

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

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