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

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 8
Komag
Roku Guru

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
Visitor

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
Channel Surfer

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
Community Streaming Expert

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
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
squirreltown
Roku Guru

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

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
Community Streaming Expert

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
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
Oak-Beard
Visitor

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