connect
search

CPL Markers

Prerequisites

  • An organization

  • Bucket(s)

  • One or more video files

Workflow

Important

All GraphQL queries and mutations related to CPL markers require the internal ID of the file(s) being operated on.

Adding Markers

To add markers to the file specified by fileId, you can use the createCplMarkers mutation. Note that the markers already present on the CPL are kept.

Note

If the CPL is invalid in any way, the mutation could throw an error unrelated to the added markers. This is due to the fact that Connect always processes the CPL as a whole, it never partially reads/writes it.

Example

Mutation

mutation CreateCplMarkers($fileId: ID!, $markers: [CplMarkerInput!]!) {
createCplMarkers(fileId: $fileId, markers: $markers) {
markers {
offset
label
}
}
}

Variables

{
"fileId": "f3609375-3d8c-4cf6-abd3-0d3518df75b7",
"markers": [
{
"label": "FFBT",
"offset": 1
},
{
"label": "FFEC",
"offset": 10
}
]
}

Assuming that the specified file didn't have any markers before the mutation, the result will be:

Response

{
"createCplMarkers": {
"markers": [
{
"label": "FFBT",
"offset": 1
},
{
"label": "FFEC",
"offset": 10
}
]
}
}

Deleting Markers

To delete existing CPL markers, you can use the deleteCplMarkers mutation. When used, it deletes all markers of the file specified by fileId.

Note

If the CPL is invalid in any way, the mutation could throw an error unrelated to the added markers. This is due to the fact that Connect always processes the CPL as a whole, it never partially reads/writes it.

Example

Mutation

mutation DeleteCplMarkers($fileId: ID!) {
deleteCplMarkers(fileId: $fileId) {
markers {
offset
label
}
}
}

Variables

{
"fileId": "f3609375-3d8c-4cf6-abd3-0d3518df75b7"
}

Response

The resulting CPL will not have any markers, so the result must always be:

{
"deleteCplMarkers": {
"markers": []
}
}

Possible Error Messages

Validations related to markers happen every time someone changes a CPL, even if the changes are not related to markers.

Here are the most common error messages:

  • offsets must be non-negative

    • error message: "Marker with negative offset (<marker-offset>) not allowed."
    • example of invalid marker:
    {
    "offset": -2,
    "label": "FFBT"
    }
  • offsets must be less than the CPL duration

    • error message: "Marker offset too big, marker offset: <marker-offset>, biggest possible offset: <CPL-duration - 1>."
    • example of invalid markers:
    [
    {
    "offset": 5,
    "label": "FFBT"
    },
    {
    "offset": 6,
    "label": "FFBT"
    }
    ]

    Assuming the duration of the CPL is 5, both markers are invalid because the offset must be strictly smaller than the duration.

MarkersGlossary