Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Overview

BrightSign’s OS version 8.2.72 and BrightAuthor:connected version 1.6.29 contain a new feature that lets users see and modify settings using the BSN.cloud Properties Panel or through the BSN.cloud API. To avoid backwards compatibility issues, the supervisor won't honor these settings unless it is first enabled in your custom Device Setup Package, custom presentation, or custom application/plugin.

This feature is natively supported and enabled in BrightAuthor:connected presentations using version 1.6.29 or later, but you must enable it if you are running custom scripts. This document describes how to enable this feature.

Pre-Requisites

  • You must be using BSN.cloud

  • Minimum BrightAuthor:connected version: 1.6.29

  • Minimum OS version: OS 8.2.72

ON THIS PAGE


Implementing the Settings Handler

To enable the Settings Handler from a custom Device Setup Package (not downloaded from BrightAuthor:connected):

  1. Include the autorun-setup.brs code snippet in your Device Setup Package (see the example below).
  2. In BrightAuthor:connected, navigate to the player’s “Network” (under the top right dropdown). The player settings are accessible in the Properties panel of BrightAuthor:connected (under the Network tab).
  3. Note: The script type would be "Setup" if the “setup script” comment in autorun-setup.brs is initialized as “setup” in order to support settings being applied from BrightAuthor:connected after the setup process is completed. The setup process is completed after the success splash screen is displayed on the player’s video HDMI output.

To enable the Settings Handler from a custom presentation or custom application/plugin, include the either the autorun-custom.brs code snippet to your custom application/plugin/presentation or attach the plugin autorun-plugin-enableSettingsHandler.brs to the presentation

Once the device-side API is turned on, the player settings will be accessible in the Properties panel of BrightAuthor:connected (under the Network tab).


API Specification

This API specification is used by custom setup package scripts, custom presentation, or plugins, either invoked by BrightScript or JavaScript, to enable the “Settings Panel” (settings handler).

ThebaseURLorplayer’sIPv4IPAddress(thedefaultportserverishostedon8000): http://localhost

GET /api/v1/system/supervisor/capabilities

Request Body

{
	"script": {
	“type”: “Custom” // Either “Custom” or “Setup”,
	“version”: “10.0.60” // Can be any version in a x.x.x format. Used to communicate script version to BSN.cloud,
	displayed in “Settings Panel” }
}

Response Body

  • Success: {"success":true}

  • Error: {"status”: <error status code>, “message”: <error message>}


Example Script

Partners who want to upgrade to use this feature must include the following code snippet in their BrightScript application/plugin. 

localBaseUrl = "http://localhost" 
supervisorApiV1Route = "/api/v1"

supervisorCapabilitiesUrlXfer = CreateObject("roUrlTransfer") supervisorCapabilitiesUrlXfer$ = localBaseUrl + supervisorApiV1Route + "/system/supervisor/capabilities" supervisorCapabilitiesUrlXfer.SetUrl(supervisorCapabilitiesUrlXfer$) supervisorCapabilitiesUrlXfer.SetTimeout(15000) supervisorCapabilitiesUrlXfer.SetProxyBypass(["127.0.0.1", "localhost"])
supervisorCapabilitiesUrlXfer.addHeader("Content-type", "application/json")
script = CreateObject("roAssociativeArray")
  
scriptType$ = "Custom" ' script type would be "Setup" if it is setup script
version$ = "10.0.60" ' current autorun script version
script.AddReplace("type", scriptType$) script.AddReplace("version", version$)
body = {} body.AddReplace("script", script)
stringifiedJson = FormatJson(body)
rc = supervisorCapabilitiesUrlXfer.PostFromString(stringifiedJson)
if rc = 200 then
	print "===settings handler enabled"
else
	print "===failed to start settings handler, error code:";rc
end if

Caveats

  • The settings handler can override custom settings applied by the setup script.

  • Edits to the property sheet settings in the interface will not be applied on the device side unless the code snippet in autorun-custom.brs is added to the runtime application (not the setup application) or autorun-plugin-enableSettingsHandler.brs is added as a plugin to the custom presentation (not the setup application).




  • No labels