Triggers Action
The Triggers action allows you to send a signal to Broadsign Control Player API to activate a specific piece of content for playback on the screen.
Note: You can run remote_action and triggers commands on Windows OS, Ubuntu Linux and Android.
When using triggers you must first assign the Follower designation to a loop policy of the frame where the triggered content will play. Once activated by a signal, the Follower frame will then immediately switch to the content that has the assigned trigger category.
All Triggers Actions that call Broadsign Control Player API, whether through monitor_remote
or otherwise, use port 2325. All other actions calling Broadsign Control Player API use port 2324. See Broadsign Control Player API - Overview.
Note: To add trigger actions, you will need to enable network triggers. See The Triggers Tab.
Note: Network triggers need to be configured in the remote configuration of the affected players. For more information, see The Triggers Tab.
The player can accept triggers using any of the following methods:
- Via a serial port using the RS-232 protocol. See Use Serial Port Triggers.
- Via the monitor_remote feature that listens for XML messages through TCP socket connections on a player's localhost. See Use Monitor Remote Triggers.
- Via a network signal (UDP broadcast, UDP multicast or TCP), where a Leader player signals Follower players on the same network. See The Triggers Tab and Use Leader Frame Triggers.
- Via ad copy commands to launch actions as an ad copy starts or ends playing. See Commands Tab.
- Via a triggering campaign that is playing on a separate frame on the same display unit.
- Via a touch on-screen event, when supported by the monitor, which initiates a designated trigger on the touched frame. See Interactive Campaigns.
Creating triggered (Follower) content can be done in three steps:
- Add a Trigger category to be used by the frames displaying the triggered content – Create a new category for the trigger with a descriptive name (for example, “Serial Trigger”). See Add a Category.
- Enable the Follower flag on the loop policies of the targeted frames – Edit the respective loop policies of the matching frames and set the Synchronization setting to Follower. The trigger event will activate and playback the content scheduled in the “Follower” loop policy. See The Settings Section.
- Book campaigns targeting the Follower frame that contain bundles with the matching trigger category (for example a bundle with category “Serial Trigger”). See Bundle Trigger Category Page.
Playlist
When the Follower campaign finishes playing, the default action is to replay the interrupted slot. However, if you use Trigger Next, Trigger Timeout, or Trigger Skip Control, you have other options. See Use Command Line Triggers.
By default, Follower frames will filter out any bundle that has a Category ID, and wait for the trigger before playing triggered content. This results in triggered content only being played when the Leader frame plays the proper content.
To allow a player to receive signals via a serial port, you must create a triggers.xml file. When bytes are available on the port the player then reads them and performs a lookup in the triggers.xml file to see if it corresponds to a category ID. If a mapping can be found, it uses the synchronization framework to instantly change the player's content.
A configurable timer will read the triggers.xml file periodically if the modified timestamp changes. This is to allow the Synchronization Monitor service to synchronize the file periodically. See Synchronization Monitor.
Note: Network triggers need to be configured in the remote configuration of the affected players. For more information, see The Triggers Tab.
All Triggers Actions that call Broadsign Control Player API, whether through monitor_remote
or otherwise, use port 2325. All other actions calling Broadsign Control Player API use port 2324. See Broadsign Control Player API - Overview.
Sample triggers.xml
<triggers version="1.0">
<device type="serial" enabled="1">
<param name="name" value="COM3"/>
<param name="internal_name" value="com_port3"/>
<param name="bps" value="9600"/>
<param name="byte_size" value="7"/>
<param name="parity" value="none"/>
<param name="read_timeout" value="50"/>
<param name="write_timeout" value="50"/>
<param name="flow_control" value="off"/>
<param name="stop_bits" value="1"/>
</device>
<trigger match="01" category_id="2840831" duration="10000"/>
<trigger match="02" category_id="2840832" duration="10000"/>
<trigger match="*" category_id="2840833" duration="10000"/>
</triggers>
Parameter | Description |
---|---|
param name | The fields are used to specify standard RS-232 port communication properties. |
trigger match | The hexadecimal information sent from an external device to the player. The special "*" match is an optional default value if no other matches are found. |
category_id | The bundle category of the content that will be triggered. |
duration | The length of time in milliseconds that the trigger content will be displayed. |
Note: Network triggers need to be configured in the remote configuration of the affected players. For more information, see The Triggers Tab.
All Triggers Actions that call Broadsign Control Player API, whether through monitor_remote
or otherwise, use port 2325. All other actions calling Broadsign Control Player API use port 2324. See Broadsign Control Player API - Overview.
When using XML triggers, it is not necessary to create a triggers.xml file.
The trigger match and category information need to be set in the XML message, and then sent to port 2325 as follows:
<rc version="1" id="1" action="trigger" trigger_category_id="1234" duration="1000"/>\r\n\r\n
Note: You must terminate the request with \r\n\r\n
.
And the response is:
<rc id="1" version="1" action="trigger" status="1"/>
Note: Each command sent requires a unique identifier (id). The application can use a simple incrementing value here.
All the frames that are on the display at the time that are set to be Follower frames will immediately play ad copy bundles that have the corresponding trigger category ID set.
Triggers Action - Parameters
Note: Any firewall present on the player should be configured to either allow bsp.exe to open ports, or configure port 2325 directly for use.
Parameter | Description |
---|---|
version | The version is always 1. |
id | Contains the ACT value. |
action | The kind of action to be taken, is always "trigger". |
trigger_category_id | The bundle category of the content that will be triggered. |
duration | The length of time in milliseconds that the trigger content will be displayed. |
Note: Network triggers need to be configured in the remote configuration of the affected players. For more information, see The Triggers Tab.
We provide a tutorial describing the steps for frame synchronization. See Frame Synchronization.
It is also possible to trigger playback in a Follower frame of a display unit by playing a trigger content in a Leader frame. This is typically used to synchronize content between frames within a single display unit.
To create triggering (Leader) and triggered (Follower) content, you must create the following:
- A trigger category to be used by the synchronizing frames – Create a new category for the trigger with a descriptive name (for example, “Synch Trigger”).
- Leader and Follower designations on the loop policies of the matching frames – Edit the respective loop policies of the paired frames and set the Synchronization flag to Leader or Follower. The trigger content in the frame using the “Leader” loop policy will trigger playback of the Follower content scheduled in the “Follower” loop policy.
- Create separate Campaigns targeting the Leader and Follower frames that contain Bundles with the matching Trigger Category (for example, “Synch Trigger”).
When a piece of content in the Leader frame is played that has a category that matches the Leader/Follower category it will then activate the content in the Follower frame.
As an example, this technique can be used to display movie show times in a side bar when the movie preview appears in the main frame.
When using external triggers it is not necessary to specify a Leader frame. This is because the Follower frame will be receiving a signal from either RS-232 or XML connections. The Follower frame, however, must use a Follower-flagged loop policy.
External Triggers for Leader Players
Behaviour of External Triggers
It is possible to set a Leader loop policy so that it accepts external triggers. The setup is done in the remote configuration associated to the Leader player where it is possible to select the set of trigger ids that will be issued from an external source.
The selected external triggers will be used when a Leader loop policy generates its playlist. Any playlist items that have a trigger id that matches one of the external triggers will be stripped from the playlist and placed in a bucket of triggerable content.
This means that any content scheduled to the Leader with a trigger that matches one of the external trigger ids will not play as part of the normal loop: it will only play when triggered via an external application.
Note: The Loop Snapshot Report does not show campaigns linked to External Triggers as “Triggered content”.
Note: Network triggers need to be configured in the remote configuration of the affected players. For more information, see The Triggers Tab.
It is also possible to issue triggers by using the built-in executable trigger. You can find it in the bin/ directory of a Broadsign Control Player installation.
Usage:
./trigger trigger_category_id [options]
Options:
-?, -h, --help: Displays this help.
-v, --version: Displays version information.
-a, --address <hostName>: Address to connect [localhost or ignored if broadcasting].
-p, --port <port>: Port to connect [2324 or 2325 if broadcasting].
-S, --ssl: Use SSL/TLSv1.
-w, --password <password>: Use provided password (Tcp only).
-d, --duration <duration>: Duration in milliseconds [0 (no duration)] (unused for action_name "condition").
-b, --broadcast: UDP Broadcast.
-u, --prebuffer <prebuffer>: Instead of playing the trigger right away, pre-buffer it for the next playback. [false]
-n, --play_next <playNext>: Instead of playing the trigger right away, insert it next in the playlist. [false]
-i, --id <playerId>: Player ID broadcasting the trigger (UDP only).
-s, --synchronization_set <sourceName>: Name of the synchronization Set.
-r, --synchronization_role <syncRole>: Synchronization Role (1 - Leader, 2 - Backup Leader).
-o, --disable_audio <disableAudio>: If supported, disable the audio. The prebuffer setting needs to be true. [false]
-t, --timeout <timeout>: When using play_next, interrupt the current content after the specified timeout in milliseconds. [0 (no timeout)]
-c, --truncate_current <truncateCurrent>: Do not restart the current content after the trigger has finished playing. [false]
Arguments:
trigger_resource_id: Trigger Category ID
- -n [ --play_next ] arg: Instead of playing the trigger right away, insert it next in the playlist.
- -t [ --timeout ] arg: When using play_next, interrupt the current content after the specified timeout in milliseconds. [0 (no timeout)]
It is possible to specify a "play next" option on external triggers so that instead of having the triggered content playing right away, it will be inserted as next in the playlist.
In addition to the play_next action, another optional timeout value can be added. This timeout value will ensure that the “Trigger Next” content does not have to wait too long before being displayed. If the currently playing content exceeds the timeout value, it will be interrupted and the trigger next content will then play.
The timeout value is optional. If not specified, the “Trigger Next” will wait until the completion of the current slot before being displayed. The timeout can be specified as a command line option for trigger and also via an XML attribute that can be sent to port 2325.
- -c [ --truncate_current ] arg: Do not restart the current content after the trigger has finished playing.
By default, when issuing a trigger causing an interrupt of the content being played back, the interrupted content restarts once the trigger is over. With the truncate_current option, this behavior will no longer apply and the next spot will be played back.
A custom application can use triggers by sending a JSON message to the WebSocket server of triggers (port 2326). You will need to enable the WebSocket server. For more information, see Devices and Triggers Section.
{
"rc": {
"synchronization_role": "2",
"truncate_current": "0",
"version": "6",
"pre_buffer": "0",
"synchronization_set": "0",
"disable_audio": "0",
"trigger_category_id": "49114",
"action": "trigger",
"id": "1"
}
}
Note: Each command sent requires a unique identifier (id). The application can use a simple incrementing value here.
The player will respond with the following document:
{
"rc": {
"id": "1",
"version": "6",
"action": "trigger",
"status": "1"
}
}
Triggers Action - JSON Parameters
If using JSON via the WebSocket server, any Firewall present on the player should be configured to access port 2326 directly for use. For more information, see The Triggers Tab.
Parameter | Description |
---|---|
id | Contains the identifier of the request. |
version | The version of the trigger action. |
action | The kind of action to be taken, in this case trigger. |
status | A result of "1" indicates that the command succeeded. |
synchronization_role | The role of the resource in the synchronization setup (1 - Leader, 2 - Backup Leader). |
truncate_current | Do not restart the current content after the trigger has finished playing. [false] |
pre_buffer | Instead of playing the trigger right away, pre-buffer it for the next playback. [false] |
synchronization_set | Name of the synchronization set. |
disable_audio | If supported, disable the audio. The pre_buffer setting needs to be true. [false] |
trigger_category_id | The ID of the trigger category. |