Forum Discussion

dynamitemedia's avatar
dynamitemedia
Binge Watcher
15 years ago

hosted .brs file(s)

I had someone tell me that they were using a "hosted " .brs file

I cant remember who that was and now i can't find it so i thought i would ask. how does that work? where would you put this in the package ect

i only want maybe one file hosted the rest will be in the package, will save on a lot of updates.

thanks in advance

8 Replies

  • I don't know about the original poster, but I would assume by "hosted" he meant that the brs file was on a web server somewhere, and his channel was downloading it and either executing it with Eval() or Run().
  • "dynamitemedia" wrote:

    i only want maybe one file hosted the rest will be in the package, will save on a lot of updates.


    If it can be done through parsing an XML, JSON or text file you download, that's much more secure and probably less likely to break in creative ways later.

    "TheEndless" wrote:
    I don't know about the original poster, but I would assume by "hosted" he meant that the brs file was on a web server somewhere, and his channel was downloading it and either executing it with Eval() or Run().


    For clarification:
    RUN() accepts a file name or set of file names and runs as if the files were a channel that just started.
    EVAL() runs the string passed as if the code was just executed.

    testvar = 1
    eval("testvar = 2")
    print testvar 'prints "2"
  • it was romeo i believe and it may have been a private message, hmmm

    his was for the playlist if i remember, no biggie just thought it be nice to be able to make quick changes server side
  • Both of the methods I and kbenson posted above will allow you to do that.
  • i already use xml now, But i guess i don't understand how the others work. and i found no reference to either or examples in the docs

    I use xml just for dynamic changes to users etc, i wanted to be able to change the.brs if it was broken or had a bug that i could fix faster this way.

    again i don't understand the methods you described sorry
  • The XML/JSON method would require you to write some supporting web page to serve the data in a known format. I think the easier route would probably be to just host a brs file as you're used to now on your web server...

    • Store the brs file on your web server at some known URL

    • Download the brs file with pre-built code in your channel to a tmp:/ location (using roUrlTransfer's GetToFile method)

    • Call Run( "tmp:/downloadedFile.brs" )

    If you're planning on publishing this channel as public, however, I suspect Roku would frown on that kind of channel configuration, as it would bypass their approval process for updates.
  • YungBlood's avatar
    YungBlood
    Streaming Star
    FYI... Hosted code is not against roku policy. We actually have a lot of freedom with roku. The games on my public channel are all hosted.

    There are some drawbacks to using hosted code. Every time someone starts your channel, it will need to pull the code from your hosting site. You can't permanently store the code on the box after you download it. The bigger the code, the longer the user will have to wait, and the more of a load it will be. I see several gigabytes of traffic per month on my games 4 roku hosting site just in traffic for the games.