Day Part Query Action
The Day Part Query action allows third party scripts to decide if the player is currently in an active day part opening hour period.
Network operators will find the Day Part Query action useful for external monitoring.
Day Part Query uses the in_day_part action.
Call the in_day_part action using one of the following:
WebSocket Server:
-
JSON – You can pass parameters from within your HTML5 file using JSON.
Note: Ensure that you select Enable Remote Control in the Remote Control tab of the configuration profile. See The Remote Control Tab.
Note: If using JSON via the WebSocket server, any firewall present on Broadsign Control Player should be configured to access port 2326 directly for use.
Port 2324:
- remote_action – An application that ships with Broadsign Control Player, using command line.
- XML – If you want to develop your own applications, you can communicate directly with Broadsign Control Player API using XML.
Note: Ensure that you select Enable Remote Control in the Remote Control tab of the configuration profile. See The Remote Control Tab.
Note: Any firewall present on Broadsign Control Player should be configured to either allow bsp.exe to open ports, or configure port 2324 or port 2326 directly for use.
Note: The Triggers Action is the only exception to this rule. It uses port 2325. See Triggers Action.
You can call this action on Windows and Ubuntu Linux, and find it along the following paths:
- Windows (64-bit):
- Ubuntu Linux:
/opt/broadsign/suite/bsp/bin/
C:\Program Files\BroadSign\bsp\bin
With the command-line remote_action tool, the action name in_day_part is to be used. The executable can be found in Broadsign Control Player’s installation bin directory. To query the player:
remote_action in_day_part
The Day Part Query returns XML that indicates if any day parts are active in an opening hour period.
When a day part is active:
<in_day_part status=”1”/>
When no day part is active:
<in_day_part status=”0”/>
Your application can submit an XML query to the Player API by sending an XML message to the monitor_remote port (2324):
<rc version="1" id="1" action="in_day_part" />\r\n\r\n
Note: You must terminate the request with \r\n\r\n
.
Note: Each command sent requires a unique identifier (id). The application can use a simple incrementing value here.
The Day Part Query returns XML that indicates if any day parts are active in an opening hour period.
When a day part is active:
<in_day_part status=”1”/>
When no day part is active:
<in_day_part status=”0”/>
Day Part Query - XML Parameters
Note: Any firewall present on Broadsign Control Player should be configured to either allow bsp.exe to open ports, or configure port 2324 or port 2326 directly for use.
Parameter | Description |
---|---|
version | The version is always "1". |
id | Contains the identifier of the request. |
action | The kind of action to be taken; always in_day_part. |
status | The status is "1" when a day part is active and Broadsign Control Player is currently within an opening hour period. In all other cases, inclusive of when Broadsign Control Player has an active day part but is outside the opening hour periods, the status returned will be "0". |
Your interactive application can submit JSON data to the player via the WebSocket server of monitor_remote (port 2326). You will need to enable the WebSocket server. For more information, see The Remote Control Tab.
{
"rc": {
"version": "1",
"id": "1",
"action": "in_day_part"
}
}
Note: Each command sent requires a unique identifier (id). The application can use a simple incrementing value here.
The Day Part Query returns a JSON string that indicates if any day parts are active in an opening hour period.
When a day part is active:
{
"rc": {
"id": "1",
"version": "1",
"status": "1",
"action": "in_day_part",
"in_day_part": { "status": "1" }
}
}
When no day part is active:
{
"rc": {
"id": "1",
"version": "1",
"status": "1",
"action": "in_day_part",
"in_day_part": { "status": "0" }
}
}
Day Part Query - JSON Parameters
Note: If using JSON via the WebSocket server, any firewall present on Broadsign Control Player should be configured to access port 2326 directly for use.
Parameter | Description |
---|---|
version | The version is always "1". |
id | Contains the identifier of the request. |
action | The kind of action to be taken; always in_day_part. |
status | The status is "1" when a day part is active and Broadsign Control Player is currently within an opening hour period. In all other cases, inclusive of when Broadsign Control Player has an active day part but is outside the opening hour periods, the status returned will be "0". |