Loop Query Action
The Loop Query actions allow third-party applications to query the Player API about a player's current playlist.
Use one of the following incident actions:
- now_playing: Queries the items currently playing in each frame.
- show_loop: Queries all items currently playing in each frame, as well as all upcoming items in the loop.
Call the now_playing and show_loop actions 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
You can query a player's loops by invoking the standalone executable remote_action which ships with Broadsign Control Player. It can be found in the player’s installation bin directory.
For example, to query the items currently playing in each frame, type:
remote_action now_playing
To query all items in each frame, as well as all upcoming items in the loop, type:
remote_action show_loop
An extra option for show_loop is depth, which controls how many future loop items will be reported:
remote_action show_loop --depth 3
Warning: Repeated calls using this action, with a high depth value, might produce performance problems. Calling show_loop with a depth
number higher than what remains in the current loop iteration will not force the player to generate future loops before they are needed. If you do not specify a depth
value, it will default to "3". For the depth to be respected, the version
value must be set to "3".
A custom application can query a player's loops by sending an XML message to the monitor_remote port (2324). Use one of the following actions. Broadsign Control Player will reply with a short XML document:
- now_playing: Retrieves the items currently playing in each frame.
- show_loop: Retrieves the items currently playing in each frame, as well as all upcoming items until the end of the current loop.
Note: now_playing will probably be invoked more frequently by third parties than show_loop. For performance reasons, now_playing should be preferred when only information about currently playing items is needed.
To retrieve the items currently playing in each frame, send:
<rc version="1" id="1" action="now_playing" frame_id="0"/>\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 player will respond with the following XML document:
<!DOCTYPE rc>
<rc status="1" id="1" version="1" action="now_playing">
<frame id="1456804" loop_policy_id="1282483" geometry_type="percent" day_part_id="1456803" width="100" name="Fullscreen" height="100" x="0" y="0" z="0">
<current_item slot_duration_ms="131518" remaining_ms="36893">
<bundle trigger_category_id="0" id="2846715" loop_weight="0" allow_custom_duration="no" category_id="0" or_conditions="" loop_category_id="0" end_date="2020-01-07" position="1" name="PlayStation Experience 2015 Final Fantasy VII Remake - PSX 2015 Trailer _ PS4" max_duration_msec="131518" secondary_category_ids="" full_screen="yes" and_conditions="" not_conditions="" attributes="">
<ad_copy id="2846708" original_filename="PlayStation Experience 2015 Final Fantasy VII Remake - PSX 2015 Trailer _ PS4.mp4" mime="mp4" name="PlayStation Experience 2015 Final Fantasy VII Remake - PSX 2015 Trailer _ PS4" flash_parameters="" feeds="" attributes="audio_codec=aac
duration=131518
height=720
video_codec=h264
volume_modifier=79
width=1280"/>
</bundle>
</current_item>
</frame>
</rc>
To retrieve the items currently playing in each frame, as well as all upcoming items until the end of the current loop, send the following:
<rc version="1" id="1" action="show_loop" frame_id="0"/>
An extra option for show_loop is depth, which controls how many future loop items will be reported:
<rc version="3" id="1" action="show_loop" depth="3" frame_id="0"/>
Warning: Repeated calls using this action, with a high depth value, might produce performance problems. Calling show_loop with a depth
number higher than what remains in the current loop iteration will not force the player to generate future loops before they are needed. If you do not specify a depth
value, it will default to "3". For the depth to be respected, the version
value must be set to "3".
Loop Query Action - 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 usually 1. |
id | Contains the identifier of the request. |
action | Required. The kind of action to be taken: either now_playing or show_loop. |
depth |
Optional. Controls how many future loop items will be reported. No limit, but too many calls of too high a value can cause performance problems. If not specified, the default is "3". For the depth to be respected, the version value must be set to "3". |
frame_id | Optional. The ID of the frame or frames on which the loop is playing. |
Your interactive application can query a player's loops 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.
Use one of the following actions. Broadsign Control Player will reply with a short JSON string:
- now_playing: Retrieves the items currently playing in each frame.
- show_loop: Retrieves the items currently playing in each frame, as well as all upcoming items until the end of the current loop.
Note: now_playing will probably be invoked more frequently by third parties than show_loop. For performance reasons, now_playing should be preferred when only information about currently playing items is needed.
To retrieve the items currently playing in each frame, send the following JSON string:
{
"rc": {
"version": "2",
"id": "1",
"action": "now_playing",
"frame_id": "0"
}
}
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:
{
"rc": {
"frame": {
"current_item": {
"bundle": {
"ad_copy": {
"id": "2846708",
"original_filename": "PlayStation Experience 2015 Final Fantasy VII Remake - PSX 2015 Trailer _ PS4.mp4",
"mime": "mp4",
"name": "PlayStation Experience 2015 Final Fantasy VII Remake - PSX 2015 Trailer _ PS4",
"flash_parameters": "",
"feeds": "",
"attributes": "audio_codec=aac\nduration=131518\nheight=720\nvideo_codec=h264\nvolume_modifier=79\nwidth=1280"
},
"trigger_category_id": "0",
"id": "2846715",
"loop_weight": "0",
"allow_custom_duration": "no",
"category_id": "0",
"or_conditions": "",
"loop_category_id": "0",
"end_date": "2020-01-07",
"position": "1",
"name": "PlayStation Experience 2015 Final Fantasy VII Remake - PSX 2015 Trailer _ PS4",
"max_duration_msec": "131518",
"secondary_category_ids": "",
"full_screen": "yes",
"and_conditions": "",
"not_conditions": "",
"attributes": ""
},
"slot_duration_ms": "131518",
"remaining_ms": "36893"
},
"id": "1456804",
"loop_policy_id": "1282483",
"geometry_type": "percent",
"day_part_id": "1456803",
"width": "100",
"name": "Fullscreen",
"height": "100",
"x": "0",
"y": "0",
"z": "0"
},
"status": "1",
"id": "1",
"version": "2",
"action": "now_playing"
}
}
To retrieve the items currently playing in each frame, as well as all upcoming items until the end of the current loop, send the following:
{
"rc": {
"version": "2",
"id": "1",
"action": "show_loop",
"frame_id": "0"
}
}
An extra option for show_loop is depth, which controls how many future loop items will be reported:
{
"rc": {
"version": "3",
"id": "1",
"action": "show_loop",
"depth": "3",
"frame_id": "0"
}
}
Warning: Repeated calls using this action, with a high depth value, might produce performance problems. Calling show_loop with a depth
number higher than what remains in the current loop iteration will not force the player to generate future loops before they are needed. If you do not specify a depth
value, it will default to "3". For the depth to be respected, the version
value must be set to "3".
Loop Query Action - 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 | Set the version to "2". |
id | Contains the identifier of the request. |
action | Required. The kind of action to be taken: either now_playing or show_loop. |
depth |
Optional. Controls how many future loop items will be reported. No limit, but too many calls of too high a value can cause performance problems. If not specified, the default is "3". For the depth to be respected, the version value must be set to "3". |
frame_id | Optional. The ID of the frame or frames on which the loop is playing. |