The Counter Showing Time Left Till The Ad Block End

Let’s consider an example of creating a counter that displays the time left till the end of the current ad block. The solution is using the Actions system of rules for the Program Channel and API elements of the SL NEO API-platform.

Actions is a specialized mechanism used in SL NEO server software that implements the event model of broadcast automation. The system of rules can be used to program execution of certain actions by the server if the set conditions trigger. The condition for the rule to trigger is playback of a certain playlist event - the condition is set while configuring the rule. When the condition is satisfied, the server implements the defined action. There is a set of certain actions that can be set for execution.

SL NEO platform API is the programming interface for interaction of third-party applications with the server. API includes a range of functions for managing graphic design. Some API functions can be called up directly from the rules (Actions) without participation of third-party applications. In our example we will use API functions to work with graphic elements of the Text Counter type, setting the counter value and launching countdown.

As an example, we will need a playlist comprising programs and ad-clips.

For clarity, ad-films are highlighted yellow, every block starts with the “Ad block” bumper. The Type column of all ad events has the “adv” value as an identifier, by which the server can separate commercials from other programs.

For our example we will need a graphic composition containing a Text Counter element.

The CountDownToNext element is a counter with the Text Counter type. Setting the External value for the counter Type parameter will provide external program control. Set the Backward type of counting.

Configuring The Graphic Layer Containing Counters

Open the Status menu section of the server control web console, in the corresponding ProgramChannel window select one of the Graphics 1…N items as the layer for the counter. In the opened window, select URL in the Source type field, specify the name of the graphic composition with the counter in the Source Name field (see the Media field in the Media Browser window).

Creating The First Rule for Program Channel

The first rule triggers on the playlist lines with the Type column value equal “adv”. The rule will also assign the counter a value equal the time till the beginning of the next program. The playlist lines with Type field values not equal “adv” will be the “programs”. To set the timer value, use the counter_set_val API-command.

Implement the following actions in the server control web console:

Open the Program Outputs tab in the Manage section, find the Actions tab in the corresponding Program Channel, click Add action. In the opened window, specify a random name for a new rule in the Name field, select a layer for triggering the rule in the Layer field. Select “1” - the first full screen layer (the main playlist layer). In the Address field, set the server IP address or leave the field empty, if the value is localhost. Press … near the Service field and select the corresponding Program Channel service. Press … near the Action field and select the Graphics action to be implemented by the server if the rule triggers.

Implement settings in the Action condition section according to the picture. Set the condition for triggering of the rule: “if the Type field value of the main playlist current column is equal adv”.

Implement settings in the Action parameters section: enter the counter_set_val command into the Param1 field - this API command sets the timer value. In the Param2 field, enter the graphic composition name with the Text Counter type. In our example, it’s the CountdownToNext object.

In the Param3 field, configure automatic calculation of time till the next “non-advertising” program. Press … near the entry field and select the Next Item field… item. Implement settings in the opened window according to the picture. We have configured search of the nearest playlist line with the Type column value not equal “adv”, and substitution of the time value till the beginning of this line in the Param3 field.

Enter the “start” value into the Param4 field and press OK.

Creating Two Rules Hiding The Counter During Regular Programs and Showing During Ad Blocks

The rule for displaying the counter during commercials uses the object_show API function

The rule for hiding the counter during regular programs uses the object_hide function

Configuring is finished, press Apply Changes at the top of the web-console. The configured program channel will be reloaded.