This document describes the public scripting API available to Template Builder and Viz Pilot Edge templates. Scripts are written in TypeScript and compiled to JavaScript for execution in the browser. This API exposes the following:
Global TypeScript types
The global
vizrtobject (template-level events & data access)The global
appobject (application-level utilities)Global helper functions
Pilot Data Types
PilotData
Contains Pilot- and MOS-related information available to scripts.
Property | Type | Description |
|---|---|---|
|
| Read-only Viz Mosart configuration |
|
| State and options for the Viz Mosart Timing Panel |
|
| MOS data and related settings |
|
| Information about the current data element |
PilotElementInfo
Property | Type | Description |
|---|---|---|
|
| ID of the currently open element |
Mosart & Timing Panel
MosartTimingPanel
Represents the state and customization options for the Viz Mosart Timing Panel.
Property | Type | Description |
|---|---|---|
|
| Available playout destinations |
|
| Whether to expose the IsLocator option |
|
| Whether to expose the ContinueCount option |
|
| Whether the panel is expanded by default (default: |
MosartConfig
Read-only Viz Mosart configuration.
Property | Type | Description |
|---|---|---|
|
| Whether the timing panel should be shown |
|
| Default Viz Mosart destinations |
|
| Whether IsLocator is shown by default |
MOS Types
MEMBlock
A MOS External Metadata (MEM) block.
Property | Type | Description |
|---|---|---|
|
| Schema URL for the block |
|
| XML payload content |
|
| The scope of the MEM block |
MEMAccess
Provides access to MEM blocks in MOS items.
Methods
Method | Description |
|---|---|
| Returns a MEM block by schema URL, or |
| Creates or updates a MEM block |
| Removes a MEM block |
MOS
Represents MOS state for the current template.
Property | Type | Description |
|---|---|---|
|
| Viz Mosart timing values MEM |
|
| Continue count MEM |
|
| MOS description |
|
| MOS abstract |
|
| MOS slug |
|
| Access to MEM blocks |
MosartTimingValues
Timing values for Viz Mosart playout.
Property | Type | Description |
|---|---|---|
|
| Playout channel |
|
| Start time |
|
| Duration |
|
| In mode |
|
| Out mode |
|
| Whether locator is enabled |
InMode
"auto" | "manual"OutMode
"auto" | "story-end" | "background-end" | "open-end"Playout & Media Sequencer Types
VizLayer
"MAIN" | "FRONT" | "BACK"PlayoutTarget<Layer>
Property | Type | Description |
|---|---|---|
|
| Media Sequencer profile |
|
| Media Sequencer channel |
|
| Viz Engine layer (default: |
MseConnection
Provides commands executed on Media Sequencer.
Methods
Method | Description |
|---|---|
| Sends Viz Engine commands |
| Executes a take command |
| Executes an update command |
| Executes a continue command |
| Executes an out command |
| Returns |
Global app Object
The app object exposes Viz Pilot Edge application utilities.
Methods
app.notify(severity, message): Displays a UI toast notification.
Parameter | Type |
|---|---|
|
|
|
|
app.createMseConnection(url): Creates anMseConnection.app.jumpToFieldPreview(path): Jumps to a specific field's preview based on the given path.app.jumpToPreviewPoint(name): Jumps to a named preview point.
Global vizrt Object
The vizrt object provides access to template fields, environment data, and lifecycle hooks.
Properties
Property | Type | Description |
|---|---|---|
|
| Environment variables |
|
| Pilot-related variables |
|
| Temporary data for dynamic editors |
|
| Template field values |
Events or Hooks
vizrt.onCreate: Called when a new data element is created in Viz Pilot Edge. Not triggered in Template Builder.vizrt.onLoad: Called when an existing data element is opened in Viz Pilot Edge. Not triggered in Template Builder.vizrt.onClick(name): Called when a click event is triggered from a UI element withvizrt-click-name.vizrt.onUpdate(fields, action): Called from Script Runner when Update Service is configured. Not triggered in Template Builder or Viz Pilot Edge.vizrt.onAfterSave: Called after the data element is saved successfully.
Global Helper Functions
createRichText(plainText, escape?): Creates a RichText object that can be assigned to the Formatted field type.createImageAsset(image, title?): Creates an ImageAsset from a URL, path or GH ID.createVideoAsset(video, title?): Creates a VideoAsset from a local file path.reportErrors(f, stage): Captures errors from a callback or async chain and reports to the UI.
Deprecated
vizrt.jumpToPreviewPoint(name)is deprecated. Useapp.jumpToPreviewPoint()instead.