Ad break workspace

Configuration

Timeline track configuration

The timeline tracks in the Program group are configured using special constants in order to perform any calculations and display the ad breaks in the program tab.

An example of track configuration for ad break markers can be seen below.

markers: {
  groups: [
    {
        match: (marker: AvMarker, track: AvTrack): boolean =>
          track?.type === "Adbreak" ||
          marker?.metadata?.has(AD_BREAK_MARKER_TYPE_KEY) ||
          marker?.metadata.get("trackId") === AdBreakTrackType.CUTS,
        title: "Program",
        id: "Adbreak",
        alwaysShow: true,
        allowCreateTrack: false,
        trackType: "Adbreak",
        applicationFilters: [
          {
            application: Application.Validate,
            workspace: PredefinedWorkspace.Adbreak,
          },
        ],
        rows: [
          {
            match: (marker: AvMarker) =>
              [
                AdBreakMarkerType.BREAK,
                AdBreakMarkerType.START,
                AdBreakMarkerType.END,
              ].includes(
                marker?.metadata.get(
                  AD_BREAK_MARKER_TYPE_KEY
                ) as AdBreakMarkerType
              ),
            track: AdBreakTrackType.BREAKS,
            title: "Start, End, Breaks",
            tooltip: (marker: AvMarker) => marker?.metadata.get("description"),
            tooltipFallback: "No description",
            order: 0,
            markerType: "Manual",
          },
          {
            match: (marker: AvMarker) =>
              marker?.metadata.get("trackId") === AdBreakTrackType.CUTS,
            form: "cutForm",
            track: AdBreakTrackType.CUTS,
            title: "Cuts",
            tooltip: (marker: AvMarker) => marker?.metadata.get("description"),
            tooltipFallback: "No description",
            order: 1,
            markerType: "Manual",
            tag: {
              tag: "Subtracted from duration",
              type: TrackTagType.Description,
            },
            markerStyle: {
              backgroundColor: "var(--AP-ERROR)",
            },
          },
        ],
      },
  ]
}

In order for the ad break workspace to function properly you have to use the following constants:

const AD_BREAK_MARKER_TYPE_KEY = "ad_break_type";

enum AdBreakTrackType {
  CUTS = "av:adbreak:track:cut",
  BREAKS = "av:adbreak:track:break",
}
enum AdBreakMarkerType {
  START = "av:adbreak:marker:start",
  BREAK = "av:adbreak:marker:break",
  END = "av:adbreak:marker:end",
}

Marker type

Every ad break marker (start, end & break) needs to have the metadata with key ad_break_type and the value corresponding to the correct type: av:adbreak:marker:start, av:adbreak:marker:break or av:adbreak:marker:end.

This is used to identify ad break markers in order to perform the correct calculations.

Constant Value Description
AD_BREAK_MARKER_TYPE_KEY ad_break_type Metadata key used to store the type of the marker (any of AdBreakMarkerType)
Enum Value Description
AdBreakMarkerType.START av:adbreak:marker:start Metadata to identify a start marker.
AdBreakMarkerType.BREAK av:adbreak:marker:break Metadata to identify a break marker.
AdBreakMarkerType.END av:adbreak:marker:end Metadata to identify a end marker.

Track type

The same way we identify markers we need to identify the tracks used for ad break markers (start, end & break) and cut markers. This is done using the AdBreakTrackType enum. The value of this enum will be stored on any marker created on that track and is used to place ad break markers and cuts in the correct track and also for calculating program durations.

Enum Value Description
AdBreakTrackType.BREAKS av:adbreak:track:break Id of the audio track, internal id used by Validate.
AdBreakTrackType.CUTS av:adbreak:track:cut Id of the audio track, internal id used by Validate.

Forms

The forms used for creating ad break markers can be configured using custom forms, see Custom forms.

In order to replace the forms for the different ad break marker types, the following forms can be overwritten:

forms: {
  adBreakStartForm: {
    ...
  },
  adBreakEndForm: {
    ...
  },
  adBreakBreakForm: {
    ...
  },
}

Start end mode

Ad break workspace can be configured to require start/end markers in order to display durations for parts and total duration, or to disable start/end markers, in which case the start and end of the proxy is used as start & end.

This setting is configured using startEndMode setting, see Validate settings.

End frame inclusive/exclusive

The behavior of ad break workspace differs when running endFrameInclusive: true and endFrameInclusive: false, see Validate settings.

Markers created in one mode will not work in the other mode, therefore you can not switch between modes with the same ad break markers.