Skip to content

Type Alias: CmcdData ​

ts
type CmcdData = CmcdV1Data | CmcdV2Data;

Defined in: CmcdData.ts:48

A CMCD data object that is either version 1 or version 2.

The v property is the discriminator:

  • When v is 2, the type narrows to CmcdV2Data with inner-list values and event/response keys.
  • When v is 1 or absent, the type narrows to CmcdV1Data with scalar values.

Example ​

ts
function process(data: CmcdData) {
  if (data.v === 2) {
    // data.bl is CmcdObjectTypeList | undefined
  } else {
    // data.bl is number | undefined
  }
}

A Streaming Video Technology Alliance project.