Advanced Conditions

Advanced conditions allow you to control when an item is displayed using JavaScript like expressions.
Data defined in the active screen, stack item, slot or sequence can be used in expressions. This data can be populated by
sensors such as GPS, player extensions (such as audience analytics tools), manually set in data fields or automatically updated by 3rd party services.
The stack item will only display if the expression evaluates to true.

Basic syntax

Syntax  Description
== Test for equality. For example temp == 23 will only return true when the data named temp is set to 23.
!= Test for inequality. For example temp != 23 will only return true when the data named temp is not set to 23.
> Test if one value is greater than another. For example temp > 23 will only return true when the data named temp is greater than 23.
< Test if one value is less than another. For example temp < 23 will only return true when the data named temp is less than 23.
>=, <= Syntax for greater than or equal to and less than or equal to.
&& Ensures two expressions are true. For example temp < 23 && screenSize > 40 only returns true when the data named temp is less than 23 and the data named screenSize is greater than 40.
|| Ensures either expression is true. For example temp < 23 || screenSize > 40 returns true when the data named temp is less than 23 or the data named screenSize is greater than 40.
(, ) Control grouping and order of evaluation. For example true || (true && false) returns true but (true || true) && false returns false.

There are a variety of predefined variables and helper functions to enable powerful logic to be defined.

Date and time functions

Syntax  Description
time.after("2014-02-01") true if time is after 1st Feb midnight.
time.after("2014-02-01 12:00") true if time is after 1st Feb 12pm.
time.before("2014-02-15 13:00") true if time is before 15th Feb 1pm.
time.hour() == 13 true if hour is 1pm.
time.decimalHour() > 13.5 true if time is after 1:30pm (decimal).
time.after("13:30") true if time is after 1:30pm (time).
time.day() == "Thursday" true if day is Thursday.
time.month() == "August" true if month is August.
time.date() == 1 true if it is the 1st day of the month.
time.between("2014-01-01", "2014-01-31") true if time is between 1st Jan 12am and 31st Jan 12am.
time.between("2014-01-01 10:00", "2014-01-31 14:00") true if time is between 1st Jan 10am and 31st Jan 2pm.
time.between("14:05", "16:30") true if time is between 2:05pm and 4:40pm.
time.between("18:00", "07:00") true if time is between 6pm and 7am of the following day.

The time zone used by default will be the time zone of the device.

Geolocation functions

Syntax  Description
distanceMiles(51.48, -0.10) < 10 true if the location of the screen is less than 10 miles from the location with latitude of 51.48 and longitude of -0.10.
distanceKilometers(51.48, -0.10) < 20 true if the location of the screen is less than 20 kilometers from the location with latitude of 51.48 and longitude of -0.10.

These functions require gpsLatitide and gpsLongitude to be set in the data. Screens will update these values automatically. For testing in the admin interface, set a test location using the Test Data Dialog.

More functions and values

Syntax  Description
random() Generates a random number between 0 and 1. For example random() < 0.5 returns true 50% of the time.
Note: Generates a new random number every time it appears in a condition.
random This value is set to a random number between 0 and 1. Note: A single number is generated after an item displays and available in all conditions. (Player 3.8+)

Devices can be configured by adding advanced player settings to the screen data. The following settings are available.

Name Default Example Description
blackCondition false time.between("18:00", "06:59") When condition is true no images or videos will be displayed and the screen output will be black. CL
standbyCondition false When condition is true the app will exit. Please note the device will not enter standby and turn off the screen until the sleep period configured in the Android OS. The app will restart after standbyPeriod and check the condition again. CL
standbyPeriod 3600000 The period to remain in standby. After this period the app will resume.
restartTime 03:00 The time the player should restart. Only use when there are stability problems. Comma separated list supported. DS Loader version 7.3+ and Player version 4.12+ required.
internetBlobsCondition true time.hour() == 3 When true images and videos will be downloaded from the Internet if not available on the local network. CL
intranetBlobsCondition true When true images and videos will be downloaded from other devices on the local network. CL
blobstoreInternal true When true internal storage will be used to store images and videos.
blobstoreExternal true When true external storage will be used to store images and videos when the internal storage has less than 128MB available. Please note, on modern devices external storage is a second internal partition. To use an SD card or USB mass storage device you must specify the full path using blobstoreDir.
blobstoreDir /mnt/external_sd Additional paths suitable for storing blobs. This path will be used if internal and external locations are disabled or have less than 128MB available. It is recommended that you create a directory on the storage device and use the full path because the root may be limited to 512 files. Multiple additional paths can be specified using blobstoreDir_0, blobstoreDir_1 etc.
overrideX 100 The x position of the desired top left of output.
overrideY 100 The y position of the desired top left of output.
overrideWidth 640 The width of the desired output.
overrideHeight 480 The height of the desired output.
collectedDataTarget A server endpoint to POST collected data such as email addresses.
maxBitmapCacheSize 20000000 The maximum RAM (in bytes) that will be used to cache bitmap images. Default is half memMax.
manageSystemUiVisibility true false Attempt to hide the System UI. Disable this option if touch events are ignored.
password password Adds a password field to the exit dialog. Password typed must match this password to exit.

CL – Conditional logic supported, for example time.between("18:00", "06:59") will automatically enable the setting between 6pm and 6:59am.

Settings required for Audience Analytics

Name Default Description
cameraId 3 The ID of the camera to use. When using a device with a single camera, set this to 0.
cameraWidth 640 The width in pixels the camera should capture.
cameraHeight 480 The height in pixels the camera should capture.
analyticsUseClient true Enable Analytics reporting. (required)
analyticsServerHost 188.138.26.160 IP address or host name of Analytics reporting server.
analyticsServerPort 20001 Port of Analytics reporting server.
analyticsReconnectInterval 5 Period in seconds to send reporting data.
analyticsDeviceKey The API key required for Analytics. (automatically generated)
analyticsDeviceId The device ID for this screen. (automatically generated)
analyticsPreview false Show Analytics processing image. (default bottom right)
analyticsPreviewX Preview position in pixels from left of screen.
analyticsPreviewY Preview position in pixels from left of screen.
analyticsPreviewWidth 640 Preview width in pixels.
analyticsPreviewHeight 480 Preview height in pixels.

Audience Analytics debugging information

Name Example Description
analyticsError Set if error detected performing audience analytics.
analyticsIsConnected true Is screen connected to Analytics servers.
analyticsIsConfigOk true Is the Analytics configuration OK.
analyticsKeyStatus OK The status of the Analytics licence key.

Screen data sent by players

Devices will periodically send the following data to the server. This data can be used in conditions to control if an item displays. For
example the condition screenWidth > 1000 would ensure the item only displays if the width of the screen is greater than
1000 pixels.

Name Example Description
freeSpace_0 121321321 The number of bytes of free space on the primary storage device.
freeSpace_1 1584680960 The number of bytes of free space on the secondary storage device.
gpsAltitude 22.299999237060547 The GPS altitude of the device.
gpsBearing 0.0 The GPS bearing of the device.
gpsLatitude 51.19537291 The GPS latitude of the device.
gpsLongitude 0.27393845 The GPS longitude of the device.
gpsSpeed 1.5206907 The GPS speed of the device.
hardware mako The hardware label assigned to the device.
hardwareBoard MAKO The hardware board label assigned to the device.
hardwareBootloader MAKOZ30d The hardware bootloader label assigned to the device.
hardwareBrand google The hardware brand label assigned to the device.
hardwareBuild KTU84P The hardware build label assigned to the device.
hardwareDevice mako The hardware device label assigned to the device.
hardwareId KTU84P The hardware ID assigned to the device.
hardwareManufacturer LGE The hardware manufacturer label assigned to the device.
hardwareModel Nexus 4 The hardware model label assigned to the device.
hardwareProduct occam The hardware product label assigned to the device.
hardwareSerial 004efcdb18961386 The hardware serial assigned to the device.
hardwareTags release-keys The hardware tags assigned to the device.
hardwareType user The hardware type label assigned to the device.
hardwareVersionCodename REL The hardware version codename assigned to the device.
loaderUdpPort 44326 The port used to communicate directly with this device using UDP.
loaderVersion 2.6 The version of the loader codebase connecting this device to the server.
memFree 439568 The number of bytes of free RAM in the active JVM the loader runs in.
memMax 201326592 The maximum number of bytes available to the JVM for code execution.
memTotal 14163968 The total number of bytes the JVM has allocated.
requiredDataAvailable 355141 The number of bytes available locally to play the currently active sequence.
requiredDataTotal 355141 The number of bytes required to play the currently active sequence.
screenDpiX 319.79 The number pixels per inch vertically. (often inaccurate)
screenDpiY 318.745 The number pixels per inch horizontally. (often inaccurate)
screenHeight 1184 The number of pixels on the screen vertically.
screenWidth 768 The number of pixels on the screen horizontally.
totalData 355141 The number of bytes stored on the device for sequence playback.
wifiSignalLevel 90 The strength of the WiFi signal.
wifiSpeed 65 The speed in megabits of the active WiFi connection.
wifiSsid SKY56566 The SSID of the access point WiFi is connected to.
plugged 2 The power status. Returns a value greater than 0 if the device is plugged in to mains power. This data is useful in the standbyCondition.

Screen data added by audience analytics

Name Example Description
males 3 The number of males detected looking at the camera.
females 2 The number of females detected looking at the camera.
kids 1 The number of children detected looking at the camera.
young 1 The number of young adults detected looking at the camera.
adults 2 The number of adults detected looking at the camera.
seniors 1 The number of seniors detected looking at the camera.

Scrolling text can be displayed on the screen. The following values are used to set and style the scrolling text and
can be added as data to the screen, sequence or item.

If scrolling text is set on a screen it can be overriden by an item. For example, adding scrollingTextCondition=false
to an item would hide the scrolling text while the item is displayed.

Name Default Example Description
scrollingText My Text Set to scroll custom text on the screen. (Android only)
scrollingTextSpeed 200 Scrolling text speed in pixels per second.
scrollingTextGravity bottom Position the scrolling text should be rendered.
scrollingTextSize 100 Text size of the scrolling text in pixels.
scrollingTextColor #FFFFFF Color of the scrolling text.
scrollingTextBackgroundColor #000000 Color of the background behind the scrolling text.
scrollingTextPadding 10 Padding between scrolling text and edge of screen.
scrollingTextCondition true When true and scrollingText set, the scrolling text will be displayed. CL

A clock can be displayed on the screen. The following values are used to set and style the clock and
can be added as data to the screen.

Name Default Example Description
timePattern HH:mm:ss Patten to define date/time formatting. Set to show time. (Android only)
timeGravity top right Position the date/time should be rendered.
timeTextSize 100 Text size of the date/time in pixels.
timeTextColor #FFFFFF Color of the text used for drawing date/time.
timePadding 10 Padding between date/time and edge of screen.
overrideTimeZone Europe/London Timezone used to display current time.

The volume of audio playback can be controlled by setting volume to a value between 0 and 1.
The volume setting can be added as data to the screen, sequence or item.

If volume is set on a screen it can be overriden by an item. For example, adding volume=0 to a video item would mute the volume when it plays.

Name Example Description
volume 0.5 Set the volume of the audio. (Android only)

Multiple screens can be synchronised to start playing items at the same time.
The screens must be on the same LAN and configured to display the same sequence or root base sequence.
When sequences share the same root base sequence, ensure items stacked above have the same duration to prevent premature sequence progression.

The screen brightness can be controlled by setting screenBrightness to a value between 0 and 1.
The brightness setting can be added as data to the screen, sequence or item.

If brightness is set on a screen it can be overriden by an item. For example, adding screenBrightness=1 to an image would set maximum brightness when it displays.

Name Example Description
screenBrightness 0.5 Set the brightness of the screen. (Android with built in screen only)

The screen orientation can be controlled by setting orientation to one of the values below.
This option will override the internal orientation sensor. Please note, some devices ignore this setting.

Name Value Description
orientation 6 Set landscape orientation
orientation 8 Set reverse landscape orientation
orientation 1 Set portrait orientation
orientation 9 Set reverse portrait orientation

See Android Documentation for more orientation settings.

Scanning Barcodes

Barcodes are automatically read when a USB barcode reader is connected (keyboard emulation). If an event is configured with a matching barcode trigger, the action will be performed.

Scanning NFC tags

NFC tags are automatically read when placed near the device. If an event is configured with a matching NFC trigger, the action will be performed.

Examples:

  • Display an image, video or sequence when a specific barcode or NFC tag is scanned.
  • Display a web page from by a 3rd party service related to the scanned barcode or NFC tag.
  • Automatically add data to the screen to control volume, standby, brightness or advanced stack item conditions with custom barcodes and NFC tags.

To display a dynamic web page for many barcodes add ~barcode in the address for the web page action.
This will be replaced with the barcode. For example https://www.example.com/shopping.php?barcode=~barcode would display the web page
https://www.example.com/shopping.php?barcode=123456789 if the barcode 123456789 was scanned.
Use ~nfcTagText for NFC tags.

Send phone to a custom web address

A phone or tablet with NFC support can also be placed near a digital signage player to open a web browser and load a web page.
To configure the destination web page address, set nfcUrl to the address of a web page.
The nfcUrl setting can be added as data to the screen, sequence or item.

To complete the NFC transfer, the digital signage screen must be touched.

Name Example Description
nfcUrl https://www.example.com Send a phone or tablet near to the screen to a web address.

NFC does not function when the digital signage player runs above the Android screen lock.

The following data can be used to control interactive presentations.

Name Default Description
enableSwipe true Enable swiping to navigate sequences.
enableTouchEvents true Enable touch events to trigger actions.
showTouchAnimations true Animate movement of items when swiped or touched.
showSequenceButtons false Display left and right navigation buttons.
showSequenceBranchBackButton true After navigating to another web page, item or sequence, show an up arrow to return.

The administration interface can be configured for specific users and cloud configurations. The following data
can be used to show, hide and disable functionality available to a user.

Name Default Description
showServerConfigs true Display the cloud config tab and list accessible cloud configs.
createServerConfig true Allow creation of new cloud configurations.
showGroups true Display the groups tab and list accessible groups.
createGroup true Allow creation of new groups.
showUsers true Display the users tab and list accessible users.
createUser true Allow creation of new users.
showUserSettingsItem true Display the user settings item.
showLibrary true Display the library tab and list accessible library items.
createLibraryItem true Allow creation of new library items.
showSequences true Display the sequences tab and list accessible sequences.
createSequence true Allow creation of new sequences.
showScreens true Display the screens tab and list accessible screens.
createScreen true Allow creation of new screens.
showReports true Show the reports tab.
showAccessControls true Display the access tab and allow user to grant access to other users and groups.
showData true Show the data tab and allow the user to add and modify raw data in objects.
createCompositeItem true Allow the creation of items that display multiple images and videos at the same time.
addCompositeWidgetItem false Allow a widget to be selected and added to a composite item.
addCompositeSequenceItem true Allow an inner sequence to be selected and added to a composite item.
pageSize 10 The number of items to display on each page. (Library items per page = 5 x pageSize)
reportPageSize 100 The number of items to display on each page of a report.
maxResults 1000 The maximum results to fetch from the server in a single request.
showAdvancedCondition true Display the advanced condition for stack items.
editStackSettings true Allow the user to edit stack settings such as maximum duration and stacking above.
showFullJson false Display the link to view the full raw JSON of a sequence.
displayItemShowBuildButton true Display button for building content using a content builder.
displayItemShowInternetButton true Display button for importing from an Internet source or displaying a web page.
displayItemShowLibraryButton true Display button for selecting an item from the library.
displayItemShowUploadButton true Display button for uploading new items.
offlineWarningDelay 604800000 The delay (in milliseconds) a screen can be offline for before adding a warning to screen status.
editUserLabel true Allow the user to edit their name.
editUserLocation true Allow the user to edit their location.
showUserAdvanced true Show the advanced tab in the edit user dialog.
editSequenceLabel true Allow sequence label to be changed. Can also be set in sequence data (user data overrides it).
showSequenceSettings true Show the sequence settings option. Can also be set in sequence data (user data overrides it).
showSequenceRemove true Show the sequence remove option. Can also be set in sequence data (user data overrides it).

Additional visibility options can be added on request.

HTML5

The platform is designed to display web pages directly from the Internet. Sometimes it is necessary to host the site locally on the device
so it can work in offline mode or reduce delays loading. To achieve these goals it is possible to create a zip file containing all the HTML and
resources for the site and upload it to the platform.

Zipped web page

Name the web page index.html and make all paths to images, JavaScript and CSS relative. Compress index.html and
resources into a single zip file. Upload the zip file as regular item and it will be recognised as a zipped web page.

The zip will automatically be extracted onto the device and read locally by the internal web browser.

PDF, SWF, DOC, PPT etc

Using these formats is not recommended. However, if they are uploaded, 3rd party viewer extensions may be used
to attempt to display them. It is best to use JPEG images and H264 encoded video for consistent output for digital signage.

Advanced content types are only supported on Android devices.