Forum Discussion

Oak-Beard's avatar
Oak-Beard
Visitor
11 years ago

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.

8 Replies

  • 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.
  • 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
  • renojim's avatar
    renojim
    Community Streaming Expert
    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
  • 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.
  • "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!
  • renojim's avatar
    renojim
    Community Streaming Expert
    "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
  • 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.