Viz Pilot User Guide

Version 7.2 | Published May 08, 2017 ©

Update Script Editor

eThis editor allows you to add scripts that will be executed by update services on the server side, and not on the client side through Director.

Unlike the Live Update mechanism that relies on Director executing the scripts, update services work on the Media Sequencer alone, and are therefore available to all products connected to the Media Sequencer.

The update script does not have access to components in the template, only the data, so the template does not need to be loaded by Director (as is the case for Live Update scripts).

This section contains the following topics:

  • Using the Update Script Editor

  • Update Services

  • Update Service Scripting

  • Viz Data Format (VDF)

Using the Update Script Editor

The Update Script Editor consists of the Script and Actions tabs.

Script

images/download/attachments/28386089/twgeneral_updatescript_editor.png

The Script tab allows you to select which of the Update Services you want to use. Either Viz Pilot system’s own Update Service or an external (third party) update service.

Actions

images/download/attachments/28386089/twgeneral_updatescript_actions.png

The Actions tab allows you to select which actions should be triggered during an update and set the timeout for each action.

Script actions are based on Read, Take, Cue and Update events that are triggered on the Media Sequencer.

When the Take action is selected, the Update at regular intervals while on air option is enabled. If this is checked, then the Media Sequencer will periodically send updates to the update service. The interval is specified by the parameter live_update_interval, and the minimum value is 2 seconds.

Note: The functionality to Update at Regular Intervals is only available if Template Wizard is connected to a database with schema Viz Pilot 6.0 or later, and Media Sequencer 3.0 or later.

Update Services

Update services are mechanisms that let the template designer decide when to update data in the template, and also which fields to update. This is useful for data that should be updated right before going on air. Typical examples are stock values, player statistics etc.

images/download/attachments/28386089/twgeneral_updateservice.png

In Template Wizard you have two options:

  1. Viz Pilot’s Update Service (Script Runner): Using this mechanism means that you can write a script updating the data that will be run by Script Runner during playout.

  2. External update service: Alternatively you can point the template (no script) to an external update service (e.g. third party), that can return updated data using the Viz Data Format (VDF). In order to implement an external update service, you need to parse and return a VDF document to the Media Sequencer. The document is posted to the external update service by the Media Sequencer.

    images/download/attachments/28386089/twgeneral_updateservice_external.png

Update Service Scripting

The entry point for using Viz Pilot’s update service (Script Runner) is a method called OnUpdatePayload. The method has the following signature: Sub OnUpdatePayload(Data).

The Data parameter contains the incoming data and the data can be modified in the OnUpdatePayload script.

Properties and methods

Data Properties

Description

Data.Count

Number of fields in the Data.

Data.FieldAt(index)

Returns a PayloadField at the given index.

Data("1")

Returns the PayloadField with the given name. "1" in this example.

PayloadField properties

Description

Name

The name of the field.

Value

The name of the field.

Example

A sample script that updates all the incoming fields and set their values to “New value from script”:

Sub OnUpdatePayload(Data)
For i=0 to Data.Count-1
Set field = Data.FieldAt(i)
field.Value = "New value from script"
Next
End Sub

Tip: Data treated outside the OnUpdatePayload function (e.g. fetching external data from files or databases) must be returned before the OnUpdatePayload function ends.

Viz Data Format (VDF)

Viz Data Format (VDF) refers to format specifications created for the purpose of data interchange between Vizrt software components. They form the basis of integration points, interoperability, reusable components and content portability.

The Viz Data Format (VDF) Payload and Model Specification can be accessed through the Pilot Data Server’s Documentation page.

Example VDF:

<?xml version="1.0" encoding="utf-8"?>
<payload model="http://localhost:8177/templates/18110/model" xmlns="http://www.vizrt.com/types">
<field name="-concept-variant-choice">
<field name="concept">
<value>Demo</value>
</field>
<field name="variant">
<value>Default</value>
</field>
</field>
<field name="1">
<value>Pilot</value>
</field>
<field name="2">
<value>rocks :)</value>
</field>
</payload>