Skip to Content

Video distribution

Video distribution integrations allow you to automatically distribute your rendered videos to various platforms and services.

When is an integration invoked?

When setting up an integration on a project level, a video delivery integration will run when a successful render is created for any template in a project. When setting up an integration on a template level, a video delivery integration will run when a successful render is created for the selected template.

Configuration

Available variables

Once the video is rendered, the following variables you can used to set up the integration:

  1. Video URL - the public URL of the video through which anyone can access the video.
  2. Video Content Type - the content type of the video, such as video/mp4 or quicktime/mov.
  3. Video Extension - the extension of the video, such as mp4 or mov.
  4. Render ID - the ID of the render.
  5. Project ID - the ID of the project.
  6. Project Name - the name of the project.
  7. Template ID - the ID of the template.
  8. Template Name - the name of the template.
  9. Integrations Passthrough (optional) - allows you to pass parameters from the render request to the integration using integration passthrough option.
  10. Video File Name - the name of the video file. If not explicitly defined using the video file name option, it will be in form of 1e89f1b8-076c-4e2b-a750-373ab227346a.mp4.
  11. Watermark Video URL (optional) - this is the public URL of the video with watermark, if the watermark option was enabled for a render.
  12. Thumbnail URLs array (optional) - the array of generated thumbnail URLs, if thumbnails generation was enabled for a render.

Options marked with (optional) will be available only if they are set up when rendering the video.

Using variables

These variables can be accessed by clicking the + button next to the parameter field when setting up the integration for the desired target tool.

Video distribution variables

Thumbnails URLs array variable handling

Thumbnails are returned as an array of objects, which need to be handled with additional setup. Here are some examples of how to get the thumbnails when setting up the integration:

Joining all thumbnail URLs into a string
  • The Map modifier is used to transform each object in the array (Thumbnail URLs Array) into just the thumbnailUrl field.
  • The field specified under the predicate is Thumbnail URL.
  • The transformation extracts the URLs from the array of objects into an array of strings.
  • After mapping, a Join modifier is applied to concatenate all the extracted URLs into a single string.
  • A comma (,) is used as the separator.
Joining all thumbnail URLs into a string
Select first thumbnail
  • The Map modifier is used to transform each object in the array (Thumbnail URLs Array) into just the thumbnailUrl field.
  • The field specified under the predicate is Thumbnail URL.
  • The transformation extracts the URLs from the array of objects into an array of strings.
  • First item is used to select the first item in the array.
Select first thumbnail

Integration options

Skip all

If you want to skip all Video distribution integrations for a specific render, you can do so by setting the Skip all option under Integrations section in the Render form. This will prevent any integration from being triggered for that render.

API cURL example - Render with skip integrations

curl -X POST \ -H "Content-Type: application/json" \ -u "[API_KEY]:" \ -d '{ "projectId": "[PROJECT_ID]", "templateId": "[TEMPLATE_ID]", "options": { "integrations": { "skipAll": true } } }' \ https://api.plainlyvideos.com/api/v2/renders

Passthrough

In some cases you want to send additional data to a Video distribution integration, and it can be done by passing the passthrough value at the time of rendering.

It’s a string value that can contain references to your own data. For example, you might want to send an internal ID, or a name of a folder where a video should be uploaded.

In addition, it’s possible to send complete JSON objects as a passthrough value, but in that case you need to URL encode or string escape the JSON string before passing it to Plainly. In that case you will need to decode back the JSON string in your integration setup.

Setting the passthrough value

You can set a passthrough value in the Render form, under the Integrations section. In batch renders, you can incorporate dynamic integration passthrough by utilizing column values from your CSV. If two or more columns are selected, the passthrough will be sent in the {key: value} JSON format.

Set integration passthrough in the render form
Set integration passthrough during batch render

Reference render parameters in a passthrough

A integration passthrough can also be dynamic. This can achieved by referencing a render parameter value. For example, setting the Passthrough to:

customer:{{customerName}}

Will take value of a customerName (mandatory) render parameter. Thus, you could get a passthrough values like customer:John Doe or customer:Jane Smith.

API cURL example - Render with integration passthrough

curl -X POST \ -H "Content-Type: application/json" \ -u "[API_KEY]:" \ -d '{ "projectId": "[PROJECT_ID]", "templateId": "[TEMPLATE_ID]", "options": { "integrations": { "passthrough": "{\"folder\": \"My folder\", \"internalId\": 123}" } } }' \ https://api.plainlyvideos.com/api/v2/renders

Using the passthrough value

The passthrough value can be used when setting up a Video delivery integration. If you want to use the string value directly, you can select it by clicking on the + button on the right side of the field:

Using integration passthrough value

However, if the Integration passthrough value is a JSON, you’ll need to parse it first. You can do this by selecting Integration Passthrough from available variables and then clicking on it in order to open the variable modifier dialog.

First select Parse option in the window that pops up, so that string is parsed to a JSON object. Then, you can select the key from the parsed JSON by utilizing the JSON path or JSONata modifiers.

Variable modifier dialog has a test option, so you can test your JSON conversion and path matching before saving it.

Available integrations