Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

BrightScript vs. JavaScript

When developing for BrightSign players, you must write in BrightScript at some point (unless you are using BrightAuthor:connected) though most users are not familiar with this language. Traditionally, every application, presentation, video, etc. that ran on a player was driven by BrightScript. Since most users today want to use JavaScript to develop applications and control the player, BrightSign has been working to accommodate that. Nevertheless, BrightScript remains integral because without an autorun.brs file, written in BrightScript, your player will not behave as intended.

Why BrightScript is Required

autorun.brs is the generic name for a file the BrightSign Operating System (BOS) searches for on the player’s configured storage device (see Image 1, below). If an autorun.brs is found, the player will execute it. It is the entry point for any application developed on a BrightSign player, and it can handle the entirety of an application (BrightAuthor:connected), be a simple pointer to more complex programs (JavaScript applications), or any mix of the two.

...

When creating a JavaScript application or presentation, the autorun.brs will typically configure the player, instantiate an HTML widget, and give the HTML widget the correct HTML file or URL. The HTML widget will then take over and run your JavaScript files.

...

When to Use BrightScript

BrightScript Required

BrightScript is required for these scenarios:

  • Player setup/configuration that must be done before a JavaScript application or presentation is loaded

    • Setting up logging level

    • Instantiating the HTML widget

    • Setting up network interfaces (on certain ports)

    • Certain file system operations

  • BrightAuthor:connected plugins

  • Autorun logging level and BOS logging (serial)

  • Any BrightScript object that doesn’t have a JavaScript alternative. A list of BrightScript objects and their JavaScript alternatives is here.

BrightScript Recommended

Though JavaScript can be used, BrightScript is recommended in these scenarios:

...