/
roElectron

roElectron

This BrightScript object launches an Electron instance from a BrightScript runtime. 

All BrightSign JavaScript objects are available to use with Electron, and BrightSign mechanisms allow communication between JavaScript (Electron main processes) and BrightScript (BrightSign processes).

This object is only available on Series 5 players.

 

Object Creation

roElectron takes two parameters: a filename and an options parameter.

aa = CreateObject("roAssociativeArray") aa.message_port = my_message_port aa.arguments = CreateObject("roArray") aa.arguments[0] = "arg1" aa.arguments[1] = "arg2" aa.node_arguments = CreateObject("roArray") aa.node_arguments = {"node_arg1", "node_arg2") aa.env_vars = CreateObject("roAssociativeArray") aa.env_vars.AddReplace("ENV_VAR_1", "test") aa.env_vars.AddReplace("ENV_VAR_2", "true") node = CreateObject("roElectron", "path/to/my/application", aa)
  • message_port optional: A message port to bridge the Electron and BrightScript applications.

  • arguments optional: An roArray of arguments for Electron

  • node_arguments optional: An roArray of arguments for the Electron application itself to consume.

  • env_vars optional: An roAssociativeArray of environment variables for Electron application.

BrightScript associative arrays are case insensitive when object-literal syntax (for example, aa={bright:"Sign"}) is used. Environment variables are generally considered as case sensitive. Use the AddReplace method with an associative array, or call SetModeCaseSensitive() before assigning object-literal syntax variables into an env_vars associative array.

Methods

PostJSMessage(data as AssociativeArray) as Boolean

Posts a collection of key:value pairs to the BrightScript MessagePort JavaScript class. This method takes an associative array but it doesn't support nested associative arrays. See JavaScript to BrightScript for more details.

Events

See roElectronEvent for information about roElectron events.

 

Related content

Setting Up a Player Without a Setup
Setting Up a Player Without a Setup
Read with this
roElectronEvent
roElectronEvent
More like this
HTML Caching
HTML Caching
Read with this
roNodeJs
More like this
HTML Video
HTML Video
Read with this
6.1-Object Reference
6.1-Object Reference
More like this