Skip navigation links

SignStix Javascript API v1.6

Introduction

See: Description

Packages 
Package Description
basic.diagnostics.javascript
Javascript-to-Player interface for sending messages from Javascript to the SignStix diagnostics.
basic.javascript
Javascript-to-Player interface for sending messages from Javascript to the SignStix reboot, restart, screenshots and other device level actions.
basic.networks.javascript
Javascript-to-Player interface for accessing content over the internet and discovering other Players on the local network.
basic.serial.javascript
Javascript-to-Player interface for providing access to serial devices connected via USB.
basic.serial.javascript.rfid
Javascript-to-Player interface for providing access to SignStix RFID pads connected via USB.
basic.serial.javascript.rfid.lift
Javascript-to-Player interface for setting up lift-and-learn experiences using SignStix RFID pads connected via USB.
config.javascript
Javascript-to-Player interface for accessing configuration settings.
data.tags.javascript
Javascript-to-Player interface for providing access to the Player's persistent tag database.
downloading.javascript
Javascript-to-Player interface for accessing files living in a folder that has been associated with a Web View and downloaded to the Player as part of its content.
player.engine.javascript
Javascript-to-Player interface for controlling the play engine.
player.stats.javascript
Javascript-to-Player interface for querying playback statistics.
signactivity.panels.javascript
Javascript-to-Player interface for storing key/value pairs across multiple Web Views.
signage.elements.javascript
Javascript-to-Player interface for modifying layers dynamically.

Introduction

The functions in this API can be called from Javascript code running inside a Web View layer within a SignStix sign.

The API provides access to various SignStix Player functionality, such as:

  1. Control the playback of signs.
  2. Store key/value pairs across multiple Web Views.
  3. Modify graphical layers within signs while they are playing.
  4. Take photos using an attached webcam.
  5. Access device settings.
  6. Query playback statistics.
  7. Log diagnostic messages during development.
  8. Communicate with attached serial devices and cameras.
  9. Access files in a folder associated with the Web View.

Compatibility

This API is supported on all SignStix devices that run the Android operating system. This includes models M12S (box), Philips D-Line (panel), APC380 (box), EKD08 (wedge), MK809III (dongle).

This version of the API is supported on SignStix Player 3.2 and above.

How to use the API

The API includes several top-level interfaces, all beginning with 'SignStix'.

  1. Each top-level interface controls a different aspect of the Player.
  2. Some top-level functions return SignStix objects e.g. Layer.
  3. Further functions are available to manipulate these objects.

Assuming the API has been enabled on a given Web View, all the interfaces are automatically available.

Use the relevant top-level interface name directly to call an API function from Javascript, for example:

    
<p>
    Hello, this device is in zone: <br/>
    <script type="text/javascript">document.write(<b>SignStixConfig.getZoneName()</b>)</script>
    <br/>
</p>

Testing

To test your web application:

  1. Use SignStix Creator to build a sign with a Web View.
  2. Set the Web View's URL to point to your web application.
  3. Your Javascript can be part of the web application, or it can go in the 'JS Extension' of the Web View.
  4. Enable the Javascript API on the Web View.
  5. Publish the sign to make it available in SignStix Director.
  6. Use Director to deploy the sign to your test device/screen.

Debugging

When developing, use the SignStixDebug interface to record information, warnings and error messages in the SignStix logging system.

The resulting messages can be viewed in 3 ways:

  1. Use the 'Diagnostics' button from the Player's Controls page to browse recent messages.
  2. Enable 'Overlay Diagnostics' in the device settings to see the messages appear immediately over the signage.
  3. Use 'Request Diagnostics' from the 'Device Admin' section of SignStix Director to request a file of recent diagnostics.

Using Javascript without a Web Page

To run a Javascript Extension on its own without a web page, set the URL of the Web View to:

about:blank

Load Timing

This note is only relevant if you are deploying a non-interactive Web View within an interactive sequence (i.e. a sequence of signs where one of more of the signs includes an interactive event).

All the signs in an interactive sequence get loaded by the Player as a single operation. (This is an efficiency measure to allow for subsequent fast switching between signs in response to user activity.) However, a consequence of this behaviour is that any Javascript intended to be triggered on page load may first execute when the sequence is loaded, not necessarily when the sign containing the Web View is displayed. Essentially, your Javascript may run sooner than you expect.

This does not apply to interactive Web Views because their content is loaded dynamically when the Web View is displayed.

Support

For further support, please visit www.signstix.com/support.

Skip navigation links