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: 
sjb64
Roku Guru

Range Requests

Will range requests be issued for 4-6 second TS files?

That's the question, here's some background if it helps...

We are hosting off Video Pro, which means Akamai, and they use cookies to secure playback, which have to stored and sent to get m3u8s and for playback since they cross domains. I also automatically attach intros and extros to my videos, that could change (season, announcement, etc.), but to put these in the same playback (without rebuffering) I have to embed them in the M3U8s at runtime. Since the intros and extros have their own Akamai generated cookies, and the video itself also has its own , I cant play them on the single videoplayer/m3u8 call as provided, since I can't send all 3 versions of the cookies (tried).

So... I load the intro and extro (each a single TS) into a tmp file on the box, along with creating my custom m3u8s, and added a small webserver segment to rovideoplayer to feed these documents on request, and this works fine. I send the 'Accept-Ranges: bytes' header on binary calls to make the box happy, but don't actually deal with a range request actually happening. Since I am only feeding a single short TS file, which would have a size well under 2mb, I'm assuming a range request wont happen, that the box uses them for large file playback (MP4, etc).

Is my assumption correct? I would hate to add the code to deal with this if I don't have to, as it would complicates the code (harder to maintain later).
0 Kudos
2 REPLIES 2
RokuMarkn
Visitor

Re: Range Requests

I don't believe range requests are ever used for TS files, but I'm not sure I'd be comfortable depending on that. I'd be more concerned about downloading video files to tmp:. They must be very small files for this to work at all, and if your videos ever get bigger, you may find this solution suddenly failing due to lack of memory. Why can't you send all the cookies that are need for both types of files? Do the cookie names conflict?

--Mark
0 Kudos
sjb64
Roku Guru

Re: Range Requests

Yes, it uses the same name for its security cookies, and to pull all three videos (intro, primary, and extro) it's 3 distinct values, messed with it a bit, trying to send them on the same m3u8 call, and couldn't get it to work. As far as downloading the files to tmp, they total about 3mb, I look for the filenames, and download (since I can run the request chain with a single security cookie) them if they don't exist, so once per session. With them being about 3Mb total, and I don't expect them to stay past the session (obviously), is that too large? Since the smallest of the boxes have 256Mb if memory serves me right, I thought those would be essentially insignificant.
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.