Skip to content

Function: fromCmcdHeaders() ​

Call Signature ​

ts
function fromCmcdHeaders(headers, options): Cmcd;

Defined in: fromCmcdHeaders.ts:24

Decode CMCD data from request headers.

Parameters ​

headers ​

| Record<string, string> | Headers

The request headers to decode.

options ​

CmcdDecodeOptions & object

Options for decoding.

Returns ​

Cmcd

The decoded CMCD data.

See ​

CTA-5004-B Header Field Definition

Example ​

ts
const headers = {
	'CMCD-Object': 'br=200',
	'CMCD-Status': 'ec=("ERR001" "ERR002"),pt=45000,rtp=8000',
	'CMCD-Request': 'su',
	'CMCD-Session': 'v=2',
}

deepEqual(fromCmcdHeaders(headers), {
	br: 200,
	ec: ['ERR001', 'ERR002'],
	pt: 45000,
	rtp: 8000,
	su: true,
	v: 2,
})

Call Signature ​

ts
function fromCmcdHeaders(headers, options?): CmcdData;

Defined in: fromCmcdHeaders.ts:38

Decode CMCD data from request headers.

Parameters ​

headers ​

| Record<string, string> | Headers

The request headers to decode.

options? ​

CmcdDecodeOptions

Options for decoding.

Returns ​

CmcdData

The decoded CMCD data.

A Streaming Video Technology Alliance project.