Stop Command Action

Third-party applications, or Flash files, can invoke the Stop Command action via the Player API. Stop Command forces the player to stop playing the current content and start playing the next item in the loop policy.

A third party application monitoring some event might want to tell Broadsign player to skip to the next file. Likewise, a dynamic Flash file might need to play in a dynamic-length slot. Then depending on some event or variable, self-terminate the slot.

You can achieve these use cases with the Stop Command action.

stop Action

You can call the Player API with the Stop Command action using one of the following methods:

    • remote_action: Exposes the stop action via the command-line remote_action tool.
    • XML: Exposes the stop action through simple XML commands sent to port 2324.
    • JSON: Exposes the stop action by sending JSON messages to the WebSocket server (port 2326).
    • Flash: Flash applications can call the Player API via ActionScript and the stop action.

To use the command-line remote_action tool, find the executable in Broadsign Player’s installation bin directory. For example, to send a stop command, type:

remote_action.exe stop -f 1234

stop: The action type.

-f: Specifies the ID of the frame to stop.

A custom application can use the Stop action on Broadsign Player by sending an XML message to the monitor_remote port (2324):

<rc version="1" id="1" action="stop" frame_id="1234" />\r\n\r\n

The player will respond with the following document:

<!DOCTYPE rc>
<rc id="1" version="1" action="stop" status="1"/>
Stop Command – XML Parameters
Parameter Description
id Contains the identifier of the request.
version The version is always 1.
action The kind of action to be taken, in this case stop.
status A result of “1” indicates that the command succeeded.
frame_id Optional. This is the ID of the frame in which the content should be stopped. If you omit frame_id, the player stops all frames that are playing content. This will simplify the programming of single-frame fullscreen layouts.

A custom application can use the Stop action by sending a JSON message to the WebSocket server of monitor_remote (port 2326). You will need to enable the WebSocket server. For more information, see Configuration Profiles – Players – The Remote Control Tab.

{
    "rc": {
        "version": "1",
        "id": "1",
        "action": "stop",
        "frame_id": "1234"
    }
}

The player will respond with the following document:

{
    "rc": {
        "id": "1",
        "version": "1",
        "action": "stop",
        "status": "1"
    }
}
Stop Command – JSON Parameters
Parameter Description
id Contains the identifier of the request.
version The version is always 1.
action The kind of action to be taken, in this case stop.
status A result of “1” indicates that the command succeeded.
frame_id Optional. This is the ID of the frame in which the content should be stopped. If you omit frame_id, the player stops all frames that are playing content. This will simplify the programming of single-frame fullscreen layouts.

The Player API can be used from Flash as follows:

// Start ActionScript 2.0
var theSocket:XMLSocket = new XMLSocket();
theSocket.onConnect = function(myStatus) {
  if (myStatus) {
    // replace xxxxxx with the appropriate frame id
    var myString:String = "<rc version=\"1\" id=\"1\"
      action=\"stop\" frame_id=\"xxxxxx\"/>\r\n\r\n";
    theSocket.send(myString);
  }
};
theSocket.connect("localhost", 2324);