Connectors
  • 19 Mar 2024
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Connectors

  • Dark
    Light
  • PDF

Article Summary

The Connectors feature is one of the most powerful features of Composer. Connectors allow you to define a custom series of commands or “actions” that can be triggered via the built-in HTTP API. This allows external systems, such as a game server, a community server, or any other external backend system, to trigger a sequence of actions within Composer. 

Connectors are very flexible and can be used for scene changes, switching cameras, starting animation playback, hiding or showing scene layers, switching audio to a different sound soundtrack, and much more.

The difference between a regular Composer API and a Connector is that a Connector will perform actions you define, while a regular API will perform a predefined command or request.

Connectors can change and animate any property or trigger commands (play, stop, connect etc) on any object within Composer. This includes all inputs, scenes, layers, operators, and targets. These changes are called Commands, and a single Connector can contain any number of Commands.

Calling a Connector from an external application is very easy. Below is an example:

https://composer.internal/api/connector/trigger?value="NoMoreBets"

In the example above, the machine name composer.internal exposes a Connector called NoMoreBets. Triggering this connector will trigger the commands defined for the "NoMoreBets" connector.

Working with Connectors

To add a new connector, use the Connectors tab and click Add connector.
The name of a connector can be changed by double-clicking on the title.
To delete a connector, select the connector and press the DELETE key or right-click and select "Delete".
To clone a connector, right-click on the connector and select the Clone popup item.
Re-arrange the order of the connectors by drag and drop.

Example: A newly added connector with the name My new API trigger, listening to any HTTP connector API-call value containing the Keyword "myTrigger":

Adding API commands (actions) to a connector

An empty connector containing no API commands (aka “actions”) does not affect Composer. 

To add API commands, click on the Add API command button.
To remove an API command, right-click on the API command and select ”Remove API command”.
Re-arrange the order of the commands by drag and drop. Holding down the ALT key will create a COPY of the command when dragging to a different connector

A connector can consist of several API commands. Each added API command will have the following properties: Target, Property, Value, Delay, Animation time, and Interpolation.

Target - item on which the API command is applied.
Property - the property of the target item on which a new value should be applied
Value - new value
Delay - delay before the API command is executed
Animation time - some properties support animation. This property sets the animation duration.
Interpolation - set the interpolation method for animated properties.

Connector example

In the example above, the connector called “My new api trigger” is defined and listens to API calls with this syntax:

http://YOURIP:PORT/api/connector/trigger?value="mytrigger"&MyPlayCuePoint=”Hello World!”

When triggered, three (3) actions will take place:

  1. Start playback of the “Taipei_Fireworks_1080p_2997.mp4” video clip.
  2. Set the metadata message to “@@MyPlayCuePoint” on the target “Vindral CDN Metadata Target”.
  3. After 200 ms, send the metadata command

Parameterized Connectors:

A Connector may also utilize parameters that are useful for some actions. One example is cue points where the Composer should send a cue point containing an eventid (or any other type of metadata). This eventid/metadata can be supplied in any Connector definition and is used by some actions. Below is an example call:

http://[YOURIP:PORT]/api/connector/trigger?value="SendCuePoint"&Param1="32"

In the example above, the Param1 value of 32 can be used in an action where a cue point is ingested into the outgoing video stream.

To pass the Param1 value into an API command, use the @@ prefix before the parameter name. Below is an example of how the @@Param1 value is used for forwarding Param1 as a message (cue point) into the Vindral CDN Metadata Target: (See 19.2 Vindral CDN Metadata Target how to set up and configure the Vindral CDN Metadata Target)



Was this article helpful?

What's Next