A remote API call can be made to trigger a pre-configured event on a specific screen or group of screens. The trigger can be used to interrupt current playback and display another item or sequence of items. It is also possible to remotely trigger JavaScript within an active web page. This makes it possible to remotely control interactive web pages. Using the ds-loader layer 1 communications (UDP), triggers are typically delivered in under 200ms.
The remote trigger API call is of the following format: /api/screen-trigger/SCREEN-MAC?name=DATA
where SCREEN-MAC is the MAC address of the screen and DATA is the data that matches the configured trigger event or provides additional data to a JavaScript function in an active web page.
To listen for triggers in an interactive web page it is necessary to have configured a function with the following name: DigitalSignageTriggerCallback
. This function will be called when the remote API call is made.
Additional JavaScript functions are available to help with building web pages controlled remotely.
Name | Description |
---|---|
function DigitalSignageStartCallback(){} |
Called when the web page starts being displayed. |
function DigitalSignageTriggerCallback(data){} |
Called when the remote trigger API is used. The data will be the data provided to the remote trigger API. |
function DigitalSignageEndCallback(){} |
Called when the web page ends being displayed (after configured duration). |
DigitalSignage.setResumeDelay(30000) |
Delays sequence progression by 30 seconds. This is useful if you know a user is still interacting and do not want to interrupt them. |
DigitalSignage.getScreenId() |
Returns the screen ID (MAC address) of the screen displaying the web page. |
DigitalSignage.getData(name) |
Gets data value of the specified name stored in the screen, active item, stack or sequence data. |
DigitalSignage.getScreenData(name) |
Gets data value of the specified name stored in the screen data. |
DigitalSignage.putScreenData(name, value) |
Puts data value in to the screen data. |
DigitalSignage.getOffsetPlaybackData(offset, name) |
Gets data value from previous (offset=-1) or next (offset=1) positions in main sequence. This can be used to populate HTML sequence frames to display what is on next for example. When offset positive, this function simulates progressing to future items. It will only return items that have a condition that evaluates to true and is fully downloaded. |
DigitalSignage.getPlayerTime() |
Returns the internal player time in milliseconds since epoch. This time is updated based on server time and is typically more accurate than the system clock (especially if NTP is blocked or disabled). |
A simple example is available here.
Comments
0 comments
Please sign in to leave a comment.