Skip to content

Function: decodeCmcd() ​

Call Signature ​

ts
function decodeCmcd(cmcd, options): Cmcd;

Defined in: decodeCmcd.ts:55

Decode a CMCD string to an object.

Parameters ​

cmcd ​

string

The CMCD string to decode.

options ​

CmcdDecodeOptions & object

Options for decoding.

Returns ​

Cmcd

The decoded CMCD object.

See ​

CTA-5004-B Payload Definition

Example ​

ts
deepEqual(decodeCmcd('br=(1000),com.example-hello="world",ec=("ERR001" "ERR002"),su,v=2'), {
	br: [1000],
	'com.example-hello': 'world',
	ec: ['ERR001', 'ERR002'],
	su: true,
	v: 2,
})

Call Signature ​

ts
function decodeCmcd<T>(cmcd, options?): T;

Defined in: decodeCmcd.ts:70

Decode a CMCD string to an object.

Type Parameters ​

T ​

T extends CmcdData = CmcdData

The type of the decoded object. Defaults to CmcdData.

Parameters ​

cmcd ​

string

The CMCD string to decode.

options? ​

CmcdDecodeOptions

Options for decoding.

Returns ​

T

The decoded CMCD object.

A Streaming Video Technology Alliance project.