Skip to content

Function: appendCmcdHeaders() ​

ts
function appendCmcdHeaders(
   headers, 
   cmcd, 
   options?
): Record<string, string>;

Defined in: appendCmcdHeaders.ts:21

Append CMCD header shards to a header object.

Parameters ​

headers ​

Record<string, string>

The headers to append to.

cmcd ​

Cmcd

The CMCD object to append.

options? ​

CmcdEncodeOptions

Options for encoding.

Returns ​

Record<string, string>

The headers with CMCD header shards appended.

Example ​

ts
const headers = {
	hello: 'world',
}

const data = {
	br: [1000],
}

deepEqual(appendCmcdHeaders(headers, data), {
	hello: 'world',
	['CMCD-Object']: 'br=(1000)',
	['CMCD-Session']: 'v=2',
})

See ​

CTA-5004-B Header Field Definition

A Streaming Video Technology Alliance project.