Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
sjb64
Level 7

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).
FlixRaider channel
0 Kudos
2 Replies
RokuMarkn
Level 7

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

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.
FlixRaider channel
0 Kudos