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

Custom Protocol Handling

Is there a way to handle custom protocol's in Roku. Essentially what I am looking for is a way for to intercept a URL within the m3u8 request and have it perform an action when Roku encounters that URI.
0 Kudos
3 REPLIES 3\
TheEndless
Level 9

Re: Custom Protocol Handling

It's not entirely clear what you're wanting to do, but you could possibly set up an roSystemLog and listen for the http.connect event for the specific URI you want to react to.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
cheungj
Level 7

Re: Custom Protocol Handling

Sorry essentially we have a HLS encrypted string but the encrypted key location is defined by a custom URL scheme. so when the player intercepts the encrypted stream and see's the custom url it processes it and uses the resulting key to play the Encrypted HLS Stream.
0 Kudos
RokuJoel
Roku Employee
Roku Employee

Re: Custom Protocol Handling

If you are able to read the .m3u8 as a text file, assuming it is not encrypted or that you can somehow decrypt it, then you should be able to look at what is in it. You could use roUrlTransfer:

function getline(url_to_get as string) as string
xfer=createobject("roURLTransfer")
xfer.seturl(url_to_get)
result=xfer.gettostring()
result=result.tokenize(chr(10))
For each line in result
if instr(line,"string value") > 0 then return line
end for
return ""
end function
0 Kudos