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: 
Oak-Beard
Level 7

is dynamic loading of brs modules possible?

I'm pretty sure the answer to this question is going to be "No" but I'll cross my fingers and ask it anyway....
Is it possible for a channel's package to use a URL to download and access additional brightscript code modules? As an example use-case, think of Vudu, Amazon, or Netflix as the channel package and when the user selects a specific title (e.g., Big Buck Bunny) some brs code specific to that title gets downloaded and invoked.

Thanks.
0 Kudos
8 Replies
Komag
Level 9

Re: is dynamic loading of brs modules possible?

The actual functions for the program have to compile and be part of the channel code, but you can download tons of data to be used by the program in interesting and creative ways.
0 Kudos
RokuMarkn
Level 7

Re: is dynamic loading of brs modules possible?

You can use Run or Eval to execute downloaded Brightscript code. Writing custom code for each piece of content doesn't seem like a great idea to me, but you can do it if you want to.

--Mark
0 Kudos
TheEndless
Level 7

Re: is dynamic loading of brs modules possible?

You can, but I don't know if it would pass for public publishing, as that would introduce the possibility of updating the channel without Roku's approval.

Take a look at the Eval and Run functions in the BrightScript Language Reference.
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
renojim
Level 8

Re: is dynamic loading of brs modules possible?

I believe there's at least one channel in the Channel Store that uses this approach, but it was added quite a long time ago and I'm not sure it still functions.

-JT
0 Kudos
squirreltown
Level 9

Re: is dynamic loading of brs modules possible?

What would be a typical use for this? I'm clueless to be sure but the only thing I could come up with was some sort of emergency remote self-destruct mechanism, which doesn't have a lot of use in a DVP, not carrying a lot of toxic rocket-fuel on board.
Kinetics Screensavers
0 Kudos
Komag
Level 9

Re: is dynamic loading of brs modules possible?

"TheEndless" wrote:
You can, but I don't know if it would pass for public publishing, as that would introduce the possibility of updating the channel without Roku's approval.


This is important to know!
0 Kudos
renojim
Level 8

Re: is dynamic loading of brs modules possible?

"squirreltown" wrote:
What would be a typical use for this? I'm clueless to be sure but the only thing I could come up with was some sort of emergency remote self-destruct mechanism, which doesn't have a lot of use in a DVP, not carrying a lot of toxic rocket-fuel on board.

Before Roku kills off support for the 1st gen boxes, I plan on creating my own channel of channels that I can update at will.

-JT
0 Kudos
Oak-Beard
Level 7

Re: is dynamic loading of brs modules possible?

First off, thanks to all who replied. I will definitely take a look at the Eval() and Run() functions.

In response to those who asked what would be a use-case for this type of approach, one that comes to mind would be a games channel. Each game would require its own custom code to handle animation, event responses, etc. It doesn't seem practical to have every game include in the channel package. Rather you would want to handle game selection in a manner similar to the way a selected movie gets accessed and downloaded from a server only when selected by the user.
0 Kudos