@svta/cml-cmcd 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,835 +1,1138 @@
1
- import { SfItem, SfToken } from "@svta/cml-structured-field-values";
2
- import { CmObjectType, CmStreamType, CmStreamingFormat } from "@svta/cml-cta";
3
- import { Request, ValueOf, ValueOrArray } from "@svta/cml-utils";
1
+ import { SfBareItem, SfItem, SfToken } from "@svta/cml-structured-field-values";
2
+ import { ExclusiveRecord, Request, ValueOf, ValueOrArray } from "@svta/cml-utils";
4
3
 
5
- //#region src/CmcdCustomKey.d.ts
4
+ //#region src/CmcdEventType.d.ts
6
5
 
7
6
  /**
8
- * A custom key for CMCD. Custom keys MUST carry a hyphenated prefix
9
- * to ensure that there will not be a namespace collision with future
10
- * revisions to this specification. Clients SHOULD use a reverse-DNS
11
- * syntax when defining their own prefix.
7
+ * CMCD event type for the 'br' key (bitrate change).
12
8
  *
13
9
  * @public
14
10
  */
15
- type CmcdCustomKey = `${string}-${string}`;
16
- //#endregion
17
- //#region src/CmcdObjectType.d.ts
11
+ declare const CMCD_EVENT_BITRATE_CHANGE: "br";
18
12
  /**
19
- * Common Media Client Data Object Type
13
+ * CMCD event type for the 'ps' key (play state change).
20
14
  *
21
15
  * @public
16
+ */
17
+ declare const CMCD_EVENT_PLAY_STATE: "ps";
18
+ /**
19
+ * CMCD event type for the 'e' key (error).
22
20
  *
23
- * @enum
21
+ * @public
24
22
  */
25
- declare const CmcdObjectType: typeof CmObjectType;
23
+ declare const CMCD_EVENT_ERROR: "e";
26
24
  /**
25
+ * CMCD event type for the 't' key (time interval).
26
+ *
27
27
  * @public
28
28
  */
29
- type CmcdObjectType = CmObjectType;
30
- //#endregion
31
- //#region src/CmcdStreamType.d.ts
29
+ declare const CMCD_EVENT_TIME_INTERVAL: "t";
32
30
  /**
33
- * Common Media Client Data Stream Type
31
+ * CMCD event type for the 'c' key (content ID).
34
32
  *
33
+ * @public
34
+ */
35
+ declare const CMCD_EVENT_CONTENT_ID: "c";
36
+ /**
37
+ * CMCD event type for the 'b' key (backgrounded mode).
35
38
  *
36
- * @enum
39
+ * @public
40
+ */
41
+ declare const CMCD_EVENT_BACKGROUNDED_MODE: "b";
42
+ /**
43
+ * CMCD event type for the 'm' key (mute).
37
44
  *
38
45
  * @public
39
46
  */
40
- declare const CmcdStreamType: typeof CmStreamType;
47
+ declare const CMCD_EVENT_MUTE: "m";
41
48
  /**
49
+ * CMCD event type for the 'um' key (unmute).
50
+ *
42
51
  * @public
43
52
  */
44
- type CmcdStreamType = CmStreamType;
45
- //#endregion
46
- //#region src/CmcdStreamingFormat.d.ts
53
+ declare const CMCD_EVENT_UNMUTE: "um";
47
54
  /**
48
- * Common Media Client Data Streaming Format
55
+ * CMCD event type for the 'pe' key (player expand).
56
+ *
57
+ * @public
58
+ */
59
+ declare const CMCD_EVENT_PLAYER_EXPAND: "pe";
60
+ /**
61
+ * CMCD event type for the 'pc' key (player collapse).
49
62
  *
63
+ * @public
64
+ */
65
+ declare const CMCD_EVENT_PLAYER_COLLAPSE: "pc";
66
+ /**
67
+ * CMCD event type for the 'rr' key (response received).
50
68
  *
51
- * @enum
69
+ * @public
70
+ */
71
+ declare const CMCD_EVENT_RESPONSE_RECEIVED: "rr";
72
+ /**
73
+ * CMCD event type for the 'as' key (ad start).
52
74
  *
53
75
  * @public
54
76
  */
55
- declare const CmcdStreamingFormat: typeof CmStreamingFormat;
77
+ declare const CMCD_EVENT_AD_START: "as";
56
78
  /**
79
+ * CMCD event type for the 'ae' key (ad end).
80
+ *
57
81
  * @public
58
82
  */
59
- type CmcdStreamingFormat = CmStreamingFormat;
60
- //#endregion
61
- //#region src/CmcdValue.d.ts
83
+ declare const CMCD_EVENT_AD_END: "ae";
62
84
  /**
63
- * CMCD Value
85
+ * CMCD event type for the 'abs' key (ad break start).
64
86
  *
65
87
  * @public
66
88
  */
67
- type CmcdValue = CmcdObjectType | CmcdStreamingFormat | CmcdStreamType | string | string[] | number | number[] | boolean | symbol | SfToken | SfItem | SfItem[];
68
- //#endregion
69
- //#region src/Cmcd.d.ts
89
+ declare const CMCD_EVENT_AD_BREAK_START: "abs";
90
+ /**
91
+ * CMCD event type for the 'abe' key (ad break end).
92
+ *
93
+ * @public
94
+ */
95
+ declare const CMCD_EVENT_AD_BREAK_END: "abe";
70
96
  /**
71
- * Common Media Client Data (CMCD) is a standardized set of HTTP request header fields and query string parameters.
97
+ * CMCD event type for the 'sk' key (skip).
72
98
  *
73
- * @see {@link https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf|CMCD Spec}
99
+ * @public
100
+ */
101
+ declare const CMCD_EVENT_SKIP: "sk";
102
+ /**
103
+ * CMCD event type for the 'ce' key (custom event).
74
104
  *
75
105
  * @public
76
106
  */
77
- type Cmcd = {
78
- /**
79
- * Custom key names may be used, but they MUST carry a hyphenated prefix to ensure that there will not be a namespace collision
80
- * with future revisions to this specification. Clients SHOULD use a reverse-DNS syntax when defining their own prefix.
81
- */
82
- [index: CmcdCustomKey]: CmcdValue;
83
- /**
84
- * Encoded bitrate
85
- *
86
- * The encoded bitrate of the audio or video object being requested. This may not be known precisely by the player; however,
87
- * it MAY be estimated based upon playlist/manifest declarations. If the playlist declares both peak and average bitrate values,
88
- * the peak value should be transmitted.
89
- *
90
- * Integer kbps
91
- */
92
- br?: number;
107
+ declare const CMCD_EVENT_CUSTOM_EVENT: "ce";
108
+ /**
109
+ * CMCD event types for the 'e' key (event mode).
110
+ *
111
+ *
112
+ * @enum
113
+ *
114
+ * @public
115
+ */
116
+ declare const CmcdEventType: {
93
117
  /**
94
- * Object duration
95
- *
96
- * The playback duration in milliseconds of the object being requested. If a partial segment is being requested, then this value
97
- * MUST indicate the playback duration of that part and not that of its parent segment. This value can be an approximation of the
98
- * estimated duration if the explicit value is not known.
99
- *
100
- * Integer milliseconds
118
+ * A change in the bitrate.
101
119
  */
102
- d?: number;
120
+ readonly BITRATE_CHANGE: typeof CMCD_EVENT_BITRATE_CHANGE;
103
121
  /**
104
- * Object type
105
- *
106
- * The media type of the current object being requested:
107
- * - `m` = text file, such as a manifest or playlist
108
- * - `a` = audio only
109
- * - `v` = video only
110
- * - `av` = muxed audio and video
111
- * - `i` = init segment
112
- * - `c` = caption or subtitle
113
- * - `tt` = ISOBMFF timed text track
114
- * - `k` = cryptographic key, license or certificate.
115
- * - `o` = other
116
- *
117
- * If the object type being requested is unknown, then this key MUST NOT be used.
122
+ * A change in the player state.
118
123
  */
119
- ot?: CmcdObjectType;
124
+ readonly PLAY_STATE: typeof CMCD_EVENT_PLAY_STATE;
120
125
  /**
121
- * Top bitrate
122
- *
123
- * The highest bitrate rendition in the manifest or playlist that the client is allowed to play, given current codec, licensing and
124
- * sizing constraints.
125
- *
126
- * Integer Kbps
126
+ * An error event.
127
127
  */
128
- tb?: number;
128
+ readonly ERROR: typeof CMCD_EVENT_ERROR;
129
129
  /**
130
- * Buffer length
131
- *
132
- * The buffer length associated with the media object being requested. This value MUST be rounded to the nearest 100 ms. This key SHOULD only be
133
- * sent with an object type of ‘a’, ‘v’ or ‘av’.
134
- *
135
- * Integer milliseconds
130
+ * A periodic report sent on a time interval.
136
131
  */
137
- bl?: number;
132
+ readonly TIME_INTERVAL: typeof CMCD_EVENT_TIME_INTERVAL;
138
133
  /**
139
- * Deadline
140
- *
141
- * Deadline from the request time until the first sample of this Segment/Object needs to be available in order to not create a buffer underrun or
142
- * any other playback problems. This value MUST be rounded to the nearest 100ms. For a playback rate of 1, this may be equivalent to the player’s
143
- * remaining buffer length.
144
- *
145
- * Integer milliseconds
134
+ * A change of the content ID.
146
135
  */
147
- dl?: number;
136
+ readonly CONTENT_ID: typeof CMCD_EVENT_CONTENT_ID;
148
137
  /**
149
- * Measured mtp CMCD throughput
150
- *
151
- * The throughput between client and server, as measured by the client and MUST be rounded to the nearest 100 kbps. This value, however derived,
152
- * SHOULD be the value that the client is using to make its next Adaptive Bitrate switching decision. If the client is connected to multiple
153
- * servers concurrently, it must take care to report only the throughput measured against the receiving server. If the client has multiple concurrent
154
- * connections to the server, then the intent is that this value communicates the aggregate throughput the client sees across all those connections.
155
- *
156
- * Integer kbps
138
+ * A change in the application's backgrounded state.
157
139
  */
158
- mtp?: number;
140
+ readonly BACKGROUNDED_MODE: typeof CMCD_EVENT_BACKGROUNDED_MODE;
159
141
  /**
160
- * Next object request
161
- *
162
- * Relative path of the next object to be requested. This can be used to trigger pre-fetching by the CDN. This MUST be a path relative to the current
163
- * request. This string MUST be URLEncoded. The client SHOULD NOT depend upon any pre-fetch action being taken - it is merely a request for such a
164
- * pre-fetch to take place.
165
- *
166
- * String
142
+ * The player was muted.
167
143
  */
168
- nor?: ValueOrArray<string | SfItem>;
144
+ readonly MUTE: typeof CMCD_EVENT_MUTE;
169
145
  /**
170
- * Next range request
171
- *
172
- * If the next request will be a partial object request, then this string denotes the byte range to be requested. If the ‘nor’ field is not set, then the
173
- * object is assumed to match the object currently being requested. The client SHOULD NOT depend upon any pre-fetch action being taken – it is merely a
174
- * request for such a pre-fetch to take place. Formatting is similar to the HTTP Range header, except that the unit MUST be ‘byte’, the ‘Range:’ prefix is
175
- * NOT required and specifying multiple ranges is NOT allowed. Valid combinations are:
176
- *
177
- * - `"\<range-start\>-"`
178
- * - `"\<range-start\>-\<range-end\>"`
179
- * - `"-\<suffix-length\>"`
180
- *
181
- * String
146
+ * Player unmuted.
182
147
  */
183
- nrr?: string;
148
+ readonly UNMUTE: typeof CMCD_EVENT_UNMUTE;
184
149
  /**
185
- * Startup
186
- *
187
- * Key is included without a value if the object is needed urgently due to startup, seeking or recovery after a buffer-empty event. The media SHOULD not be
188
- * rendering when this request is made. This key MUST not be sent if it is FALSE.
189
- *
190
- * Boolean
150
+ * The player view was expanded.
191
151
  */
192
- su?: boolean;
152
+ readonly PLAYER_EXPAND: typeof CMCD_EVENT_PLAYER_EXPAND;
193
153
  /**
194
- * Content ID
195
- *
196
- * A unique string identifying the current content. Maximum length is 64 characters. This value is consistent across multiple different
197
- * sessions and devices and is defined and updated at the discretion of the service provider.
198
- *
199
- * String
154
+ * The player view was collapsed.
200
155
  */
201
- cid?: string;
156
+ readonly PLAYER_COLLAPSE: typeof CMCD_EVENT_PLAYER_COLLAPSE;
202
157
  /**
203
- * Playback rate
204
- *
205
- * `1` if real-time, `2` if double speed, `0` if not playing. SHOULD only be sent if not equal to `1`.
206
- *
207
- * Decimal
158
+ * The receipt of a response.
208
159
  */
209
- pr?: number;
160
+ readonly RESPONSE_RECEIVED: typeof CMCD_EVENT_RESPONSE_RECEIVED;
210
161
  /**
211
- * Streaming format
212
- *
213
- * The streaming format that defines the current request.
214
- *
215
- * - `d` = MPEG DASH
216
- * - `h` = HTTP Live Streaming (HLS)
217
- * - `s` = Smooth Streaming
218
- * - `o` = other
219
- *
220
- * If the streaming format being requested is unknown, then this key MUST NOT be used.
162
+ * The start of an ad.
221
163
  */
222
- sf?: CmcdStreamingFormat;
164
+ readonly AD_START: typeof CMCD_EVENT_AD_START;
223
165
  /**
224
- * Session ID
225
- *
226
- * A GUID identifying the current playback session. A playback session typically ties together segments belonging to a single media asset.
227
- * Maximum length is 64 characters. It is RECOMMENDED to conform to the UUID specification.
228
- *
229
- * String
166
+ * The end of an ad.
230
167
  */
231
- sid?: string;
168
+ readonly AD_END: typeof CMCD_EVENT_AD_END;
232
169
  /**
233
- * Stream type
234
- * - `v` = all segments are available – e.g., VOD
235
- * - `l` = segments become available over time – e.g., LIVE
170
+ * The start of an ad break.
236
171
  */
237
- st?: CmcdStreamType;
172
+ readonly AD_BREAK_START: typeof CMCD_EVENT_AD_BREAK_START;
238
173
  /**
239
- * CMCD version
240
- *
241
- * The version of this specification used for interpreting the defined key names and values. If this key is omitted, the client and server MUST
242
- * interpret the values as being defined by version 1. Client SHOULD omit this field if the version is 1.
243
- *
244
- * Integer
174
+ * The end of an ad break.
245
175
  */
246
- v?: number;
176
+ readonly AD_BREAK_END: typeof CMCD_EVENT_AD_BREAK_END;
247
177
  /**
248
- * Buffer starvation
249
- *
250
- * Key is included without a value if the buffer was starved at some point between the prior request and this object request,
251
- * resulting in the player being in a rebuffering state and the video or audio playback being stalled. This key MUST NOT be
252
- * sent if the buffer was not starved since the prior request.
253
- *
254
- * If the object type `ot` key is sent along with this key, then the `bs` key refers to the buffer associated with the particular
255
- * object type. If no object type is communicated, then the buffer state applies to the current session.
256
- *
257
- * Boolean
178
+ * The user skipped an ad.
258
179
  */
259
- bs?: boolean;
180
+ readonly SKIP: typeof CMCD_EVENT_SKIP;
260
181
  /**
261
- * Requested maximum throughput
262
- *
263
- * The requested maximum throughput that the client considers sufficient for delivery of the asset. Values MUST be rounded to the
264
- * nearest 100kbps. For example, a client would indicate that the current segment, encoded at 2Mbps, is to be delivered at no more
265
- * than 10Mbps, by using rtp=10000.
266
- *
267
- * Note: This can benefit clients by preventing buffer saturation through over-delivery and can also deliver a community benefit
268
- * through fair-share delivery. The concept is that each client receives the throughput necessary for great performance, but no more.
269
- * The CDN may not support the rtp feature.
270
- *
271
- * Integer kbps
182
+ * A custom event.
272
183
  */
273
- rtp?: number;
184
+ readonly CUSTOM_EVENT: typeof CMCD_EVENT_CUSTOM_EVENT;
274
185
  };
186
+ /**
187
+ * @public
188
+ */
189
+ type CmcdEventType = ValueOf<typeof CmcdEventType>;
275
190
  //#endregion
276
- //#region src/CMCD_EVENT_MODE.d.ts
191
+ //#region src/CmcdCustomKey.d.ts
277
192
  /**
278
- * CMCD event mode variable name.
193
+ * A custom key for CMCD. Custom keys MUST carry a hyphenated prefix
194
+ * to ensure that there will not be a namespace collision with future
195
+ * revisions to this specification. Clients SHOULD use a reverse-DNS
196
+ * syntax when defining their own prefix.
279
197
  *
280
198
  * @public
281
199
  */
282
- declare const CMCD_EVENT_MODE = "event";
200
+ type CmcdCustomKey = `${string}-${string}`;
283
201
  //#endregion
284
- //#region src/CMCD_REQUEST_MODE.d.ts
202
+ //#region src/CmcdCustomValue.d.ts
285
203
  /**
286
- * CMCD request mode variable name.
204
+ * A value type for custom CMCD keys.
287
205
  *
288
206
  * @public
289
207
  */
290
- declare const CMCD_REQUEST_MODE = "request";
208
+ type CmcdCustomValue = string | SfItem<string> | (string | SfItem<string>)[] | number | SfItem<number> | (number | SfItem<number>)[] | boolean | SfItem<boolean> | (boolean | SfItem<boolean>)[] | symbol | SfItem<symbol> | (symbol | SfItem<symbol>)[] | SfToken | SfItem<SfToken> | (SfToken | SfItem<SfToken>)[];
291
209
  //#endregion
292
- //#region src/CmcdReportingMode.d.ts
210
+ //#region src/CmcdObjectType.d.ts
293
211
  /**
294
- * CMCD reporting mode types.
212
+ * Common Media Client Data Object Type
295
213
  *
214
+ * @public
296
215
  *
297
216
  * @enum
298
- *
299
- * @public
300
217
  */
301
- declare const CmcdReportingMode: {
218
+ declare const CmcdObjectType: {
302
219
  /**
303
- * Request mode
220
+ * text file, such as a manifest or playlist
304
221
  */
305
- readonly REQUEST: typeof CMCD_REQUEST_MODE;
222
+ readonly MANIFEST: "m";
306
223
  /**
307
- * Event mode
224
+ * audio only
308
225
  */
309
- readonly EVENT: typeof CMCD_EVENT_MODE;
310
- };
311
- /**
312
- * @public
313
- */
314
- type CmcdReportingMode = ValueOf<typeof CmcdReportingMode>;
315
- //#endregion
316
- //#region src/CmcdFormatterOptions.d.ts
317
- /**
318
- * Options for formatting CMCD data values.
319
- *
320
- * @public
321
- */
322
- type CmcdFormatterOptions = {
226
+ readonly AUDIO: "a";
323
227
  /**
324
- * The version of the CMCD specification to use.
228
+ * video only
325
229
  */
326
- version: number;
230
+ readonly VIDEO: "v";
327
231
  /**
328
- * The reporting mode to use.
232
+ * muxed audio and video
329
233
  */
330
- reportingMode: CmcdReportingMode;
234
+ readonly MUXED: "av";
331
235
  /**
332
- * The base URL to use for relative URLs.
236
+ * init segment
333
237
  */
334
- baseUrl?: string;
238
+ readonly INIT: "i";
239
+ /**
240
+ * caption or subtitle
241
+ */
242
+ readonly CAPTION: "c";
243
+ /**
244
+ * ISOBMFF timed text track
245
+ */
246
+ readonly TIMED_TEXT: "tt";
247
+ /**
248
+ * cryptographic key, license or certificate.
249
+ */
250
+ readonly KEY: "k";
251
+ /**
252
+ * other
253
+ */
254
+ readonly OTHER: "o";
335
255
  };
336
- //#endregion
337
- //#region src/CmcdFormatter.d.ts
338
256
  /**
339
- * A formatter for CMCD values.
340
- *
341
- * @param value - The value to format.
342
- *
343
- * @returns The formatted value.
344
- *
345
257
  * @public
346
258
  */
347
- type CmcdFormatter = (value: CmcdValue, options: CmcdFormatterOptions) => number | ValueOrArray<string> | ValueOrArray<SfItem>;
259
+ type CmcdObjectType = ValueOf<typeof CmcdObjectType>;
348
260
  //#endregion
349
- //#region src/CmcdEventExcludedKeys.d.ts
261
+ //#region src/CmcdObjectTypeList.d.ts
350
262
  /**
351
- * Keys that are excluded from CMCD event mode.
263
+ * A numeric list with an optional object type boolean flag.
352
264
  *
353
265
  * @public
354
266
  */
355
- type CmcdEventExcludedKeys = "bsd" | "d" | "dl" | "nor" | "ot" | "rtp" | "sid" | "su";
267
+ type CmcdObjectTypeList = (number | SfItem<number, ExclusiveRecord<CmcdObjectType, boolean>>)[];
356
268
  //#endregion
357
- //#region src/CmcdEventType.d.ts
269
+ //#region src/CmcdPlayerState.d.ts
358
270
  /**
359
- * CMCD event types for the 'e' key (event mode).
271
+ * CMCD v2 player states for the 'sta' key.
360
272
  *
361
273
  *
362
274
  * @enum
363
275
  *
364
276
  * @public
365
277
  */
366
- declare const CmcdEventType: {
278
+ declare const CmcdPlayerState: {
367
279
  /**
368
- * A change in the player state.
280
+ * Starting: Initial startup of the player.
369
281
  */
370
- readonly PLAY_STATE: "ps";
282
+ readonly STARTING: "s";
371
283
  /**
372
- * An error event.
284
+ * Playing: The player is actively rendering content.
373
285
  */
374
- readonly ERROR: "e";
286
+ readonly PLAYING: "p";
375
287
  /**
376
- * A periodic report sent on a time interval.
288
+ * Seeking: The player is seeking to a new position.
377
289
  */
378
- readonly TIME_INTERVAL: "t";
290
+ readonly SEEKING: "k";
379
291
  /**
380
- * A change of the content ID.
292
+ * Rebuffering: The player is buffering data during playback.
381
293
  */
382
- readonly CONTENT_ID: "c";
294
+ readonly REBUFFERING: "r";
383
295
  /**
384
- * A change in the application's backgrounded state.
296
+ * Paused: The player is paused.
385
297
  */
386
- readonly BACKGROUNDED_MODE: "b";
298
+ readonly PAUSED: "a";
387
299
  /**
388
- * The player was muted.
300
+ * Waiting: The player is waiting for a user action or another event.
389
301
  */
390
- readonly MUTE: "m";
302
+ readonly WAITING: "w";
391
303
  /**
392
- * Player unmuted.
304
+ * Ended: The media has finished playing.
393
305
  */
394
- readonly UNMUTE: "um";
306
+ readonly ENDED: "e";
395
307
  /**
396
- * The player view was expanded.
308
+ * Fatal Error: The player has encountered a fatal error.
397
309
  */
398
- readonly PLAYER_EXPAND: "pe";
310
+ readonly FATAL_ERROR: "f";
399
311
  /**
400
- * The player view was collapsed.
312
+ * Quit: User initiated end of playback before media asset completion.
401
313
  */
402
- readonly PLAYER_COLLAPSE: "pc";
314
+ readonly QUIT: "q";
403
315
  /**
404
- * The receipt of a response.
316
+ * Preloading: The player is loading assets ahead of starting in order to provide a fast startup. The expectation is that playback will commence at a future time.
405
317
  */
406
- readonly RESPONSE_RECEIVED: "rr";
318
+ readonly PRELOADING: "d";
407
319
  };
408
320
  /**
409
321
  * @public
410
322
  */
411
- type CmcdEventType = ValueOf<typeof CmcdEventType>;
323
+ type CmcdPlayerState = ValueOf<typeof CmcdPlayerState>;
412
324
  //#endregion
413
- //#region src/CmcdPlayerState.d.ts
325
+ //#region src/CmcdStreamType.d.ts
414
326
  /**
415
- * CMCD v2 player states for the 'sta' key.
327
+ * Common Media Client Data Stream Type
416
328
  *
417
329
  *
418
330
  * @enum
419
331
  *
420
332
  * @public
421
333
  */
422
- declare const CmcdPlayerState: {
423
- /**
424
- * Starting: Initial startup of the player.
425
- */
426
- readonly STARTING: "s";
334
+ declare const CmcdStreamType: {
427
335
  /**
428
- * Playing: The player is actively rendering content.
336
+ * All segments are available e.g., VOD
429
337
  */
430
- readonly PLAYING: "p";
338
+ readonly VOD: "v";
431
339
  /**
432
- * Seeking: The player is seeking to a new position.
340
+ * Segments become available over time e.g., LIVE
433
341
  */
434
- readonly SEEKING: "k";
342
+ readonly LIVE: "l";
435
343
  /**
436
- * Rebuffering: The player is buffering data during playback.
344
+ * Low latency stream
437
345
  */
438
- readonly REBUFFERING: "r";
439
- /**
440
- * Paused: The player is paused.
441
- */
442
- readonly PAUSED: "a";
346
+ readonly LOW_LATENCY: "ll";
347
+ };
348
+ /**
349
+ * @public
350
+ */
351
+ type CmcdStreamType = ValueOf<typeof CmcdStreamType>;
352
+ //#endregion
353
+ //#region src/CmcdStreamingFormat.d.ts
354
+ /**
355
+ * Common Media Client Data Streaming Format
356
+ *
357
+ *
358
+ * @enum
359
+ *
360
+ * @public
361
+ */
362
+ declare const CmcdStreamingFormat: {
443
363
  /**
444
- * Waiting: The player is waiting for a user action or another event.
364
+ * MPEG DASH
445
365
  */
446
- readonly WAITING: "w";
366
+ readonly DASH: "d";
447
367
  /**
448
- * Ended: The media has finished playing.
368
+ * HTTP Live Streaming (HLS)
449
369
  */
450
- readonly ENDED: "e";
370
+ readonly HLS: "h";
451
371
  /**
452
- * Fatal Error: The player has encountered a fatal error.
372
+ * Smooth Streaming
453
373
  */
454
- readonly FATAL_ERROR: "f";
374
+ readonly SMOOTH: "s";
455
375
  /**
456
- * Quit: User initiated end of playback before media asset completion.
376
+ * Other
457
377
  */
458
- readonly QUIT: "q";
459
- /**
460
- * Preloading: The player is loading assets ahead of starting in order to provide a fast startup. The expectation is that playback will commence at a future time.
461
- */
462
- readonly PRELOADING: "d";
378
+ readonly OTHER: "o";
463
379
  };
464
380
  /**
465
381
  * @public
466
382
  */
467
- type CmcdPlayerState = ValueOf<typeof CmcdPlayerState>;
383
+ type CmcdStreamingFormat = ValueOf<typeof CmcdStreamingFormat>;
468
384
  //#endregion
469
385
  //#region src/CmcdRequest.d.ts
470
386
  /**
471
- * Common Media Client Data (CMCD) is a standardized set of HTTP request header fields and query string parameters.
387
+ * Common Media Client Data (CMCD) version 2 - Request Mode.
388
+ *
389
+ * A standardized set of HTTP request header fields and query string parameters
390
+ * for communicating media playback metrics in request mode.
391
+ *
392
+ * @see {@link https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf|CMCD v1 Spec}
472
393
  *
473
394
  * @public
474
395
  */
475
- type CmcdRequest = Omit<Cmcd, "nrr"> & {
396
+ type CmcdRequest = {
397
+ /**
398
+ * Custom key names may be used, but they MUST carry a hyphenated prefix to ensure that there will not be a namespace collision
399
+ * with future revisions to this specification. Clients SHOULD use a reverse-DNS syntax when defining their own prefix.
400
+ */
401
+ [index: CmcdCustomKey]: CmcdCustomValue | undefined;
476
402
  /**
477
403
  * Aggregate encoded bitrate
478
404
  *
479
- * The aggregate encoded bitrate of the complete media object including all object types. This SHOULD be derived from
480
- * playlist/manifest declarations, or it MAY be estimated by the player. If the playlist declares both peak and average bitrate values,
481
- * the peak value MUST be transmitted. This value MUST NOT be sent for objects which do not have an object type of 'a', 'v', 'av' or 'o'.
482
- * This value MUST NOT be sent if the encoded bitrate is known.
405
+ * The aggregate encoded bitrate across a playable combination of tracks. This metric SHOULD NOT be used when the individual bitrates
406
+ * of the tracks are known. This value SHOULD be derived from a playlist/manifest declaration, or it MAY be estimated by the player.
407
+ * If the playlist declares both peak and average bitrate values, the peak value MUST be transmitted. This value MUST NOT be sent if
408
+ * the encoded bitrate is known.
483
409
  *
484
- * Integer kbps
410
+ * Inner list of integer kbps with token identifiers
485
411
  */
486
- ab?: number;
412
+ ab?: CmcdObjectTypeList;
487
413
  /**
488
- * Target buffer length (ms)
414
+ * Backgrounded
489
415
  *
490
- * The target buffer length associated with the media object being requested at the time of the request.
491
- * This value SHOULD be rounded to the nearest 100 ms. This value MUST NOT be sent for objects which do not have an object
492
- * type of 'a', 'v', 'av', 'tt', 'c', or 'o'
416
+ * All players in a session are currently in a state that is not visible to the user due to a user interaction. This key SHOULD only
417
+ * be sent if it is TRUE. If the visibility state of the player is not known this key SHOULD NOT be reported.
493
418
  *
494
- * Integer milliseconds
419
+ * Boolean
420
+ */
421
+ bg?: boolean;
422
+ /**
423
+ * Buffer length
424
+ *
425
+ * The buffer length associated with the media object being requested. This value SHOULD be rounded to the nearest 100 ms.
426
+ *
427
+ * Inner list of integer milliseconds with token identifiers
495
428
  */
496
- tbl?: number;
429
+ bl?: CmcdObjectTypeList;
497
430
  /**
498
- * CDN ID (string, max 128 chars)
431
+ * Encoded bitrate
499
432
  *
500
- * A string identifying the current delivery network from which the player is retrieving content. Maximum length is 128 characters
433
+ * The encoded bitrate. In request mode, this refers to the encoded bitrate of the requested representation.
434
+ * In event mode this refers to the encoded bitrate of the currently selected representation.
435
+ * This SHOULD be derived from playlist/manifest declarations, or it MAY be estimated by the player.
436
+ * If the playlist declares both peak and average bitrate values, the peak value MUST be transmitted.
437
+ *
438
+ * Inner list of integer kbps with token identifiers
439
+ */
440
+ br?: CmcdObjectTypeList;
441
+ /**
442
+ * Buffer starvation
443
+ *
444
+ * TRUE if the player buffer was starved at some point between the prior report and this report per reporting destination, resulting in
445
+ * the player entering a rebuffering state or remaining in a rebuffering state. Note that if the player begins requesting data from a
446
+ * new CDN, then this key might initially report buffering caused by the prior CDN. This key SHOULD NOT be reported if it is FALSE.
447
+ *
448
+ * Boolean
449
+ */
450
+ bs?: boolean;
451
+ /**
452
+ * Buffer Starvation Absolute
453
+ *
454
+ * An absolute count of buffer starvation events since session initiation. A buffer starvation event occurs when the state changes
455
+ * to rebuffering. Token identifier MAY be omitted if the cause of the rebuffering is unknown.
456
+ *
457
+ * Inner list of integers with optional token identifiers
458
+ */
459
+ bsa?: CmcdObjectTypeList;
460
+ /**
461
+ * Buffer Starvation Duration
462
+ *
463
+ * A list of durations of each buffer starvation period reported once the rebuffering has completed. This value MUST only be reported
464
+ * once per reporting mode and report destination. Token identifier MAY be omitted if the cause of the rebuffering is unknown.
465
+ *
466
+ * Inner list of integer milliseconds with optional token identifiers
467
+ */
468
+ bsd?: CmcdObjectTypeList;
469
+ /**
470
+ * Buffer Starvation Duration Absolute
471
+ *
472
+ * An absolute count of buffer starvation duration since session initiation. Token identifier MAY be omitted if the cause of the
473
+ * rebuffering is unknown.
474
+ *
475
+ * Inner list of integer milliseconds with optional token identifiers
476
+ */
477
+ bsda?: CmcdObjectTypeList;
478
+ /**
479
+ * CDN ID
480
+ *
481
+ * A string identifying the current delivery network from which the player is retrieving content. Maximum length is 128 characters.
501
482
  *
502
483
  * String
503
484
  */
504
485
  cdn?: string;
505
486
  /**
506
- * Live stream latency (ms)
487
+ * Content ID
507
488
  *
508
- * The time delta between when a given media timestamp was made available at the origin and when it was rendered by the client.
509
- * The accuracy of this estimate is dependent on synchronization between the packager and the player clocks.
489
+ * A unique string identifying the current content. The maximum length is 128 characters. This value is consistent across multiple different
490
+ * sessions and devices and is defined and updated at the discretion of the service provider.
510
491
  *
511
- * Integer Milliseconds
492
+ * String
512
493
  */
513
- ltc?: number;
494
+ cid?: string;
514
495
  /**
515
- * Backgrounded (all players in session not visible, boolean)
496
+ * Content Signature
516
497
  *
517
- * All players in a session are currently in a state that is not visible to the user.
518
- * This key SHOULD only be sent if it is TRUE.
519
- * If the visibility state of the player is not known this key SHOULD NOT be reported
498
+ * A string representing a signature of the content being played. This field SHOULD vary with content ID and be bound by some mechanism
499
+ * to the content. For example, this field may be used to transmit the C2PA signature associated with the content being viewed.
520
500
  *
521
- * Bool
501
+ * String
522
502
  */
523
- bg?: boolean;
503
+ cs?: string;
524
504
  /**
525
- * State (player state, e.g. "s", "p", etc.)
505
+ * Object duration
526
506
  *
527
- * A token describing the current playback state of the player as perceived by the end user, one of:
528
- * s - starting: the player has been instructed to play media for a given session, either by a user interaction or by an autoplay action.
529
- * p - playing : Media is being rendered.
530
- * k - seeking : The start of the user initiated action of moving the playhead position.
531
- * r - rebuffering : Media has stopped being rendered due to an insufficient buffer. This state is not reported during startup or seeking.
532
- * a - paused : Playback has been intentionally paused by the user.
533
- * w - waiting : Playback has been paused by the player.
534
- * e - ended : Rendering has ended due to completion of the media asset playback.
535
- * f - fatal error : Rendering has ended due to an irrecoverable error.
536
- * q - quit : User initiated end of playback before media asset completion.
537
- * d - preloading : the player is loading assets ahead of starting in order to provide a fast startup. The expectation is that playback will commence at a future time.
538
- *
539
- * Note: if used with Request Mode or Response Mode, then this key represents a snapshot of the state at request time, which may obscure prior state changes since the last request.
540
- * For most accurate state tracking in players, use State-Interval mode.
541
- * The addition of a timestamp in Request Mode might be useful in correctly placing the state change on a timeline.
542
- *
543
- * Token - one of [s,p,k,r,a,w,e,f,q,d]
507
+ * The playback duration in milliseconds of the object being requested. If a partial segment is being requested,
508
+ * then this value MUST indicate the playback duration of that part and not that of its parent segment.
509
+ * This value can be an approximation of the estimated duration if the explicit value is not known.
510
+ * This value MUST NOT be sent for objects which do not have an object type of 'a', 'v', 'av', 'tt', 'c', or 'o'.
511
+ *
512
+ * Integer milliseconds
544
513
  */
545
- sta?: CmcdPlayerState;
514
+ d?: number;
546
515
  /**
547
- * The encoded bitrate of the audio or video object being shown to the end user.
516
+ * Dropped Frames Absolute
548
517
  *
549
- * Integer Kbps
518
+ * An absolute count of dropped frames since session initiation. This key SHOULD only be sent for content types of 'v', 'av' or 'o'.
519
+ * Note that this value will be driven by the content being rendered rather than the content being retrieved, therefore it is
520
+ * beneficial if accompanied by the playhead time 'pt' key to allow for correct interpretation.
521
+ *
522
+ * Integer
550
523
  */
551
- pb?: number;
524
+ dfa?: number;
552
525
  /**
553
- * Timestamp (ms since UNIX epoch, required for event mode)
526
+ * Deadline
554
527
  *
555
- * The timestamp at which the associated event occurred, expressed as milliseconds since the UNIX epoch.
556
- * When the event is a request for a media object the time SHOULD reference when the request was first initiated.
557
- * When used with Response Mode, the timestamp should indicate the time at which the object was first requested and not when it was received.
528
+ * Deadline from the request time until the first sample of this Segment/Object needs to be available in order to not create a buffer underrun
529
+ * or any other playback problems. This value MUST be rounded to the nearest 100ms. For a playback rate of 1, this may be equivalent to the
530
+ * player's remaining buffer length.
558
531
  *
559
532
  * Integer milliseconds
560
533
  */
561
- ts?: number;
534
+ dl?: number;
562
535
  /**
563
- * Top playable bitrate (kbps)
536
+ * Player Error Code
564
537
  *
565
- * The highest bitrate rendition that the player is currently capable of playing for reasons other than bandwidth limitations.
566
- * This key captures the cases in which, for example, screen resolution, DRM, or performance constraints limit the player's topmost choice of bitrate.
567
- * These constraints are intentionally obfuscated for privacy reasons.
568
- * This key can increase the fingerprinting surface exposed by CMCD transmission and SHOULD NOT be transmitted in a default player configuration.
538
+ * A string defining an error code produced by the player. The namespace and formatting of this error code is left to the application.
569
539
  *
570
- * If the playlist declares both peak and average bitrate values, the peak value MUST be transmitted.
571
- * This top playable bitrate MUST apply to the object type being requested.
572
- * Requests for video objects MUST specify the top playable video bitrate and requests for audio objects MUST specify the top playable audio bitrate.
573
- * This value MUST NOT be sent for objects which do not have an object type of 'a', 'v', 'av' or 'c'.
540
+ * Even if only one error code is being specified, the list notation MUST still be used.
574
541
  *
575
- * Integer Kbps
542
+ * Inner list of strings
576
543
  */
577
- tpb?: number;
544
+ ec?: string[];
578
545
  /**
579
- * Lowest encoded bitrate (kbps)
546
+ * Lowest aggregated encoded bitrate
580
547
  *
581
- * The lowest bitrate rendition in the manifest or playlist.
582
- * This SHOULD be derived from playlist/manifest declarations, or it MAY be estimated by the player.
583
- * If the playlist declares both peak and average bitrate values, the peak value MUST be transmitted.
584
- * This lowest bitrate MUST apply to the object type being requested.
585
- * Requests for video objects MUST specify the lowest video bitrate and requests for audio objects MUST specify the lowest audio bitrate.
586
- * This value MUST NOT be sent for objects which do not have an object type of 'a', 'v', 'av' or 'c'.
548
+ * The lowest aggregated bitrate rendition in the manifest or playlist. This SHOULD be derived from playlist/manifest declarations,
549
+ * or it MAY be estimated by the player. If the playlist declares both peak and average bitrate values, the peak value MUST be
550
+ * transmitted. The aggregate encoded bitrate is of the complete media object including all object types. This value MUST NOT be
551
+ * sent if the lowest encoded bitrate is known.
587
552
  *
588
- * Integer Kbps
553
+ * Inner list of integer kbps with token identifiers
589
554
  */
590
- lb?: number;
555
+ lab?: CmcdObjectTypeList;
591
556
  /**
592
- * Top aggregated encoded bitrate (kbps)
557
+ * Lowest encoded bitrate
593
558
  *
594
- * The highest aggregated bitrate rendition in the manifest or playlist.
595
- * This SHOULD be derived from playlist/manifest declarations, or it MAY be estimated by the player.
596
- * If the playlist declares both peak and average bitrate values,the peak value MUST be transmitted.
597
- * The aggregate encoded bitrate is of the complete media object including all object types.
598
- * This value MUST NOT be sent for objects which do not have an object type of 'a', 'v', 'av' or 'c'.
599
- * This value MUST NOT be sent if the top encoded bitrate is known
559
+ * The lowest bitrate rendition in the manifest or playlist. This SHOULD be derived from playlist/manifest declarations, or it MAY be
560
+ * estimated by the player. If the playlist declares both peak and average bitrate values, the peak value MUST be transmitted. This
561
+ * lowest bitrate MUST apply to the object type being requested. Requests for video objects MUST specify the lowest video bitrate and
562
+ * requests for audio objects MUST specify the lowest audio bitrate.
600
563
  *
601
- * Integer Kbps
564
+ * Inner list of integer kbps with token identifiers
602
565
  */
603
- tab?: number;
566
+ lb?: CmcdObjectTypeList;
604
567
  /**
605
- * Lowest aggregated encoded bitrate (kbps)
568
+ * Live stream latency
606
569
  *
607
- * The lowest aggregated bitrate rendition in the manifest or playlist.
608
- * This SHOULD be derived from playlist/manifest declarations, or it MAY be estimated by the player.
609
- * If the playlist declares both peak and average bitrate values, the peak value MUST be transmitted.
610
- * The aggregate encoded bitrate is of the complete media object including all object types.
611
- * This value MUST NOT be sent for objects which do not have an object type of 'a', 'v', 'av' or 'c'.
612
- * This value MUST NOT be sent if the lowest encoded bitrate is known.
570
+ * The time delta between when a given media timestamp was made available at the origin and when it was rendered by the player. The
571
+ * accuracy of this estimate is dependent on synchronization between the packager and the player clocks.
613
572
  *
614
- * Integer Kbps
573
+ * Integer milliseconds
574
+ */
575
+ ltc?: number;
576
+ /**
577
+ * Media Start Delay
578
+ *
579
+ * Measures the initial delay in wall-clock time from when a player is instructed to play media for a given session to when any media
580
+ * begins playback, whether it be primary content or interstitial content. This value SHOULD be the time difference between the
581
+ * "starting" and "playing" states.
582
+ *
583
+ * This key MUST only be sent once per Session ID and MUST be sent for each reporting mode which is active within the player.
584
+ *
585
+ * Integer milliseconds
586
+ */
587
+ msd?: number;
588
+ /**
589
+ * Measured throughput
590
+ *
591
+ * The throughput between player and server, as measured by the player. Throughput MUST be rounded to the nearest 100 kbps. This value, however
592
+ * derived, SHOULD be the value that the player is using to make its next Adaptive Bitrate switching decision. If the player is requesting
593
+ * different object types from different providers then it SHOULD take care to match the throughput measured against that provider with each
594
+ * object type request. It is acceptable to report aggregate information if objects of the same type are requested from different providers.
595
+ * If the player has multiple concurrent connections to the provider, then the intent is that this value communicates the aggregate throughput
596
+ * the player sees across all those connections. If this key is sent on an interval report, the value transmitted should be the last throughput
597
+ * estimate made by the player prior to making the report. There is no requirement for the player to calculate the average measured throughput
598
+ * since the prior interval report.
599
+ *
600
+ * Inner list of integer kbps with token identifiers
601
+ */
602
+ mtp?: CmcdObjectTypeList;
603
+ /**
604
+ * Next object request
605
+ *
606
+ * The relative path, as defined by RFC 3986, to one or more objects which can reasonably be expected to be requested by the player making
607
+ * the current request. Each object SHOULD be fetched in its entirety unless there is a range associated with the future request. Even if
608
+ * only one object is being specified, the list notation MUST still be used. If there is a range associated with the future request, then
609
+ * the range is communicated as the parameter 'r' with a String value. The formatting of the String value is similar to the HTTP Range
610
+ * header, except that the unit MUST be 'byte', the 'Range:' prefix is NOT permitted, specifying multiple ranges is NOT allowed and the
611
+ * only valid combinations are:
612
+ *
613
+ * - `"<range-start>-"`
614
+ * - `"<range-start>-<range-end>"`
615
+ * - `"-<suffix-length>"`
616
+ *
617
+ * The player SHOULD NOT depend upon any pre-fetch action being taken - it is merely a request for such a pre-fetch to take place.
618
+ *
619
+ * Inner list of strings
620
+ */
621
+ nor?: (string | SfItem<string, {
622
+ r: string;
623
+ }>)[];
624
+ /**
625
+ * Non rendered
626
+ *
627
+ * True when the content being retrieved by a player is not rendered as audio or video. The key SHOULD only be sent when it is TRUE.
628
+ *
629
+ * Boolean
630
+ */
631
+ nr?: boolean;
632
+ /**
633
+ * Object type
634
+ *
635
+ * The media type of the current object being requested:
636
+ * - `m` = text file, such as a manifest or playlist
637
+ * - `a` = audio only
638
+ * - `v` = video only
639
+ * - `av` = muxed audio and video
640
+ * - `i` = init segment
641
+ * - `c` = caption or subtitle
642
+ * - `tt` = ISOBMFF timed text track
643
+ * - `k` = cryptographic key, license or certificate.
644
+ * - `o` = other
645
+ *
646
+ * If the object type being requested is unknown, then this key MUST NOT be used.
647
+ *
648
+ * This key is also used as a token parameter for other keys.
649
+ *
650
+ * Token
651
+ */
652
+ ot?: CmcdObjectType;
653
+ /**
654
+ * Playhead bitrate
655
+ *
656
+ * The encoded bitrate of the media object(s) being shown to the end user.
657
+ *
658
+ * Inner list of integer kbps with token identifiers
615
659
  */
616
- lab?: number;
660
+ pb?: CmcdObjectTypeList;
617
661
  /**
618
- * Playhead time (ms)
662
+ * Playback rate
663
+ *
664
+ * 1.0 if real-time, 2.0 if double speed, 0 if not playing. SHOULD only be sent if not equal to 1.0.
665
+ *
666
+ * Decimal
667
+ */
668
+ pr?: number;
669
+ /**
670
+ * Playhead time
619
671
  *
620
672
  * The playhead time, expressed in milliseconds, which is being rendered to the viewer when the report is made.
621
- * For Response and State-Interval modes, this corresponds to the playhead time that was rendered at the wallclock time reported by the timestamp field.
622
673
  *
623
674
  * Integer milliseconds
624
675
  */
625
676
  pt?: number;
626
677
  /**
627
- * Error code(s), application-defined
678
+ * Requested maximum throughput
628
679
  *
629
- * A string defining an error code produced by the player.
630
- * The namespace and formatting of this error code is left to the application.
631
- * Use of standardized error codes is recommended.
632
- * Errors should be buffered per report destination as they occur and reported along with the next CMCD report.
633
- * With Event mode there is the option to report errors as they occur.
680
+ * The requested maximum throughput that the player considers sufficient for delivery of the asset. Values MUST be rounded to the
681
+ * nearest 100kbps.
634
682
  *
635
- * An Inner List of Strings
683
+ * Integer kbps
636
684
  */
637
- ec?: string | string[];
685
+ rtp?: number;
638
686
  /**
639
- * Media Start Delay (ms)
687
+ * Streaming format
640
688
  *
641
- * Measures the initial delay in wall-clock time from when a player is instructed to play media for a given session to when any media begins playback,
642
- * whether it be primary content or interstitial content.
643
- * This value SHOULD be the time difference between the "starting" and "playing" states.
644
- * This key MUST only be sent once per Session ID and MUST be sent for each reporting mode which is active within the player.
645
- * For request and response reporting modes, this key SHOULD be sent on the next media object request following successful startup.
689
+ * The streaming format that defines the current request.
646
690
  *
647
- * Integer milliseconds
691
+ * - `d` = MPEG DASH
692
+ * - `h` = HTTP Live Streaming (HLS)
693
+ * - `e` = HESP
694
+ * - `s` = Smooth Streaming
695
+ * - `o` = other
696
+ *
697
+ * Token
648
698
  */
649
- msd?: number;
699
+ sf?: CmcdStreamingFormat;
700
+ /**
701
+ * Session ID
702
+ *
703
+ * A GUID identifying the current playback session. A playback session typically consists of the playback of a single media asset along
704
+ * with accompanying content such as advertisements. This session may comprise the playback of primary content combined with interstitial
705
+ * content. This session is being played on a single device. The maximum length is 64 characters. It is RECOMMENDED to conform to the
706
+ * UUID specification.
707
+ *
708
+ * String
709
+ */
710
+ sid?: string;
650
711
  /**
651
712
  * Sequence Number
652
713
  *
653
- * A monotonically increasing integer to identify the sequence of a CMCD report to a target within a session. This MUST be reset to zero on the start of
654
- * a new session-id. Sequence numbers increase independently per each combination of mode and target.
714
+ * A monotonically increasing integer to identify the sequence of a CMCD report to a target within a session. This MUST be reset to
715
+ * zero on the start of a new session-id. Sequence numbers increase independently per each combination of mode and target.
655
716
  *
656
717
  * Integer
657
718
  */
658
719
  sn?: number;
659
720
  /**
660
- * Buffer starvation duration
721
+ * Stream type
661
722
  *
662
- * Duration of the latest rebuffering period reported once the rebuffering has completed. This value MUST only be reported once per rebuffering incident, per object type.
723
+ * - `v` = all segments are available - e.g., VOD
724
+ * - `l` = segments become available over time - e.g., LIVE
725
+ * - `ll` = low latency LIVE
663
726
  *
664
- * If the object type 'ot' key is sent along with this key, then the 'bsd' key refers to the buffer associated with the particular object type. If no object type is communicated, then the buffer state applies to the current session.
727
+ * Token
728
+ */
729
+ st?: CmcdStreamType;
730
+ /**
731
+ * State
665
732
  *
666
- * Integer milliseconds
733
+ * A token describing the current playback state of the player as perceived by the end user, one of:
734
+ *
735
+ * - `s` - starting: the player has been instructed to play media for a given session, either by a user interaction or by an autoplay action.
736
+ * - `p` - playing: Media is being rendered.
737
+ * - `k` - seeking: The start of the action of moving the playhead position after starting.
738
+ * - `r` - rebuffering: Media has stopped being rendered due to an insufficient buffer. This state is not reported during startup or seeking.
739
+ * - `a` - paused: Playback has been intentionally paused by either the user or the player.
740
+ * - `e` - ended: Rendering has ended due to completion of the media asset playback.
741
+ * - `f` - fatal error: Rendering has ended due to an irrecoverable error.
742
+ * - `q` - quit: User initiated end of playback before media asset completion.
743
+ * - `d` - preloading: the player is loading, or has loaded, assets ahead of starting in order to provide a fast startup. The expectation is that playback will commence at a future time.
744
+ *
745
+ * Token - one of [s,p,k,r,a,e,f,q,d]
667
746
  */
668
- bsd?: number;
747
+ sta?: CmcdPlayerState;
669
748
  /**
670
- * Dropped Frames
749
+ * Startup
671
750
  *
672
- * An absolute count of dropped frames since session initiation. This key should only be sent for content types of 'v','av' or 'o'.
673
- * Note that this value will be driven by the content being rendered rather than the content being retrieved, therefore it is beneficial if accompanied by the playhead time 'pt' key to allow for correct interpretation.
751
+ * Key is included without a value if the object is needed urgently due to startup, seeking or recovery after a buffer-empty event. The player
752
+ * reports this key as true until its buffer first reaches the target buffer for stable playback.
674
753
  *
675
- * Integer
754
+ * Boolean
755
+ */
756
+ su?: boolean;
757
+ /**
758
+ * Top aggregated encoded bitrate
759
+ *
760
+ * The highest aggregated bitrate rendition in the manifest or playlist. This SHOULD be derived from playlist/manifest declarations,
761
+ * or it MAY be estimated by the player. If the playlist declares both peak and average bitrate values, the peak value MUST be
762
+ * transmitted. The aggregate encoded bitrate is of the complete media object including all object types. This value MUST NOT be
763
+ * sent if the top encoded bitrate is known.
764
+ *
765
+ * Inner list of integer kbps with token identifiers
676
766
  */
677
- df?: number;
767
+ tab?: CmcdObjectTypeList;
678
768
  /**
679
- * Content Signature
769
+ * Top encoded bitrate
680
770
  *
681
- * A string representing a signature of the content being played. This field SHOULD vary with content ID and be bound by some mechanism to the content.
682
- * For example, this field may be used to transmit the C2PA signature associated with the content being viewed.
771
+ * The highest bitrate rendition in the manifest or playlist. This SHOULD be derived from playlist/manifest declarations,
772
+ * or it MAY be estimated by the player. If the playlist declares both peak and average bitrate values, the peak value
773
+ * MUST be transmitted. This top bitrate MUST apply to the object type being requested. Requests for video objects MUST
774
+ * specify the top video bitrate and requests for audio objects MUST specify the top audio bitrate.
683
775
  *
684
- * Integer bytes
776
+ * Inner list of integer kbps with token identifiers
685
777
  */
686
- cs?: number;
778
+ tb?: CmcdObjectTypeList;
779
+ /**
780
+ * Target Buffer length
781
+ *
782
+ * The target buffer length associated with the media object being requested at the time of the request. This value SHOULD be rounded
783
+ * to the nearest 100 ms.
784
+ *
785
+ * Inner list of integer milliseconds with token identifiers
786
+ */
787
+ tbl?: CmcdObjectTypeList;
788
+ /**
789
+ * Top playable bitrate
790
+ *
791
+ * The highest bitrate rendition that the player is currently capable of playing for reasons other than bandwidth limitations. This
792
+ * key captures the cases in which, for example, screen resolution, DRM, or performance constraints limit the player's topmost choice
793
+ * of bitrate. These constraints are intentionally obfuscated for privacy reasons.
794
+ *
795
+ * This key can increase the fingerprinting surface exposed by CMCD transmission and SHOULD NOT be transmitted in a default player
796
+ * configuration.
797
+ *
798
+ * If the playlist declares both peak and average bitrate values, the peak value MUST be transmitted. This top playable bitrate MUST
799
+ * apply to the object type being requested. Requests for video objects MUST specify the top playable video bitrate and requests for
800
+ * audio objects MUST specify the top playable audio bitrate. This value MUST NOT be sent for objects which do not have an object type
801
+ * of 'a', 'v', 'av' or 'c'.
802
+ *
803
+ * Inner list of integer kbps with token identifiers
804
+ */
805
+ tpb?: CmcdObjectTypeList;
806
+ /**
807
+ * Version
808
+ *
809
+ * The version of this specification used for interpreting the defined key names and values. If this key is omitted, the player and server
810
+ * MUST interpret the values as being defined by version 1. Player SHOULD omit this field if the version is 1 and MUST include this field
811
+ * if the version is not 1.
812
+ *
813
+ * Integer
814
+ */
815
+ v?: number;
687
816
  };
688
817
  //#endregion
689
818
  //#region src/CmcdEvent.d.ts
690
819
  /**
691
- * CMCD v2 - Event Mode.
820
+ * Common Media Client Data (CMCD) version 2 - Event Mode.
692
821
  *
693
- * Represents the event and keys for CMCD v2.
822
+ * Extends {@link CmcdRequest} with event-specific keys for reporting events
823
+ * according to the CMCD version 2 specification.
694
824
  *
695
- * This type is used to structure the data for reporting events according to the
696
- * Common Media Client Data (CMCD) version 2 specification. It encapsulates
697
- * the reporting event token.
825
+ * @public
826
+ */
827
+ type CmcdEvent = CmcdRequest & {
828
+ /**
829
+ * Custom Event Name
830
+ *
831
+ * Used to define a custom event name. A maximum length of 64 characters is allowed. This key MUST be sent when the event type is
832
+ * 'ce' (custom event) and MUST NOT be sent when the event type is any other value. A custom key-value pair MAY be used to transfer
833
+ * a custom value associated with this event. The names chosen SHOULD associate the custom event name with the custom key name.
834
+ *
835
+ * String
836
+ */
837
+ cen?: string;
838
+ /**
839
+ * Event
840
+ *
841
+ * This key MUST only be used in Event mode and MUST be present on all reports. The minimum recommended set of supported events
842
+ * are: `ps`, `e`, `t`, and `rr`.
843
+ *
844
+ * - `abs` - ad break start
845
+ * - `abe` - ad break end
846
+ * - `ae` - ad end
847
+ * - `as` - ad start
848
+ * - `b` - backgrounded mode
849
+ * - `bc` - bitrate change
850
+ * - `c` - content ID changed
851
+ * - `ce` - custom event
852
+ * - `e` - error
853
+ * - `h` - hostname changed
854
+ * - `m` - mute
855
+ * - `pc` - player collapse
856
+ * - `pe` - player expand
857
+ * - `pr` - playback rate change
858
+ * - `ps` - play state change
859
+ * - `rr` - response received
860
+ * - `sk` - skip
861
+ * - `t` - time interval
862
+ * - `um` - unmute
863
+ *
864
+ * Token
865
+ */
866
+ e?: CmcdEventType;
867
+ /**
868
+ * Hostname
869
+ *
870
+ * A string identifying the current hostname from which the player is retrieving content. Maximum length is 128 characters.
871
+ *
872
+ * String
873
+ */
874
+ h?: string;
875
+ /**
876
+ * Timestamp
877
+ *
878
+ * The timestamp at which the associated event occurred, expressed as the number of milliseconds that have elapsed since the Unix
879
+ * Epoch (January 1, 1970, at 00:00:00 UTC), excluding leap seconds. When the event is a request for a media object the time SHOULD
880
+ * reference when the request was first initiated.
881
+ *
882
+ * This key MUST be included with all Event reports.
883
+ *
884
+ * Integer milliseconds
885
+ */
886
+ ts?: number;
887
+ };
888
+ //#endregion
889
+ //#region src/CmcdResponse.d.ts
890
+ /**
891
+ * Common Media Client Data (CMCD) version 2 - Response Mode.
892
+ *
893
+ * Extends {@link CmcdRequest} with response-specific keys for reporting
894
+ * response data according to the CMCD version 2 specification.
698
895
  *
699
896
  * @public
700
897
  */
701
- type CmcdEvent = Omit<CmcdRequest, CmcdEventExcludedKeys> & {
898
+ type CmcdResponse = CmcdRequest & {
702
899
  /**
703
- * Event (event mode; e.g. "e", "t", "ps")
900
+ * CMSD Dynamic Header
704
901
  *
705
- * This key MUST only be used in Event mode.
902
+ * Holds a Base64 encoded copy of the CMSD data received on the CMSD-Dynamic response header. This key MUST only be reported on
903
+ * events of type `rr` (response received).
706
904
  *
707
- * ps - play state change. This token MUST be accompanied by a 'sta' key carrying the new state.
905
+ * String
906
+ */
907
+ cmsdd?: string;
908
+ /**
909
+ * CMSD Static Header
708
910
  *
709
- * e - the player has experienced an error. This token MUST be accompanied by a 'ec' key defining the player error code.
911
+ * Holds a Base64 encoded copy of the CMSD data received on the CMSD-Static response header. This key MUST only be reported on
912
+ * events of type `rr` (response received).
710
913
  *
711
- * t - time interval. The interval at which these reports are made is application-defined. A default interval of 30 seconds SHOULD
712
- * be used if no explicit application interval is provided. Short form content may wish to use a shorter interval.
713
- * An application-defined interval of zero should be interpreted as turning off interval event reporting.
714
- * This event MUST be supported by all players that support Event mode.
914
+ * String
915
+ */
916
+ cmsds?: string;
917
+ /**
918
+ * Response code
715
919
  *
716
- * c - content ID has changed. This token MUST be accompanied by a 'cid' key defining the new content ID.
920
+ * The response code received when requesting a media object. In a redirect scenario, this would be the final response code received.
921
+ * A value of 0 SHOULD be used to indicate that a response was not received.
717
922
  *
718
- * b - the player has entered backgrounded mode if this event is accompanied by the ‘bg’ key and exited backgrounded mode if not.
923
+ * This key MUST only be reported on events of type `rr` (response received).
719
924
  *
720
- * m - mute. The user activated the mute control or set the volume to zero.
925
+ * Integer
926
+ */
927
+ rc?: number;
928
+ /**
929
+ * SMRT-Data Header
721
930
  *
722
- * um - unmute. The user deactivated the mute control or raised the volume above zero if it was previously set to zero.
931
+ * Holds a Base64 encoded copy of the streaming media response tracing data received on the Request Tracing header. This key MUST
932
+ * only be reported on events of type `rr` (response received).
723
933
  *
724
- * pe - playerExpand. The user activated a control to extend the player to a larger size. The definition of this event is intended to be
725
- * compliant with the VAST [VAST] Player Operation Metrics.
934
+ * String
935
+ */
936
+ smrt?: string;
937
+ /**
938
+ * Time to first byte
726
939
  *
727
- * c - playerCollapse: the user activated a control to reduce the player to a smaller size. The definition of this event is intended to be
728
- * compliant with the VAST [VAST] Player Operation Metrics.
940
+ * The elapsed time between when the request was first initiated (captured in ts) and the time when the first byte of the response
941
+ * was received. This key MUST only be reported on events of type `rr` (response received).
729
942
  *
730
- * Token - one of [ps,e,t,c,b,m,u m, abs, abe, as, ae]
943
+ * Integer milliseconds
731
944
  */
732
- e?: CmcdEventType;
945
+ ttfb?: number;
946
+ /**
947
+ * Time to first body byte
948
+ *
949
+ * The elapsed time between when the request was first initiated (captured in ts) and the time the first bytes of the response body
950
+ * are received. This key MUST only be reported on events of type `rr` (response received).
951
+ *
952
+ * Integer milliseconds
953
+ */
954
+ ttfbb?: number;
955
+ /**
956
+ * Time to last byte
957
+ *
958
+ * The elapsed time between when the request was first initiated (captured in ts) and the time the response body is fully received.
959
+ * This key MUST only be reported on events of type `rr` (response received).
960
+ *
961
+ * Integer milliseconds
962
+ */
963
+ ttlb?: number;
964
+ /**
965
+ * Request URL
966
+ *
967
+ * The URL used to request the media object. If the request is redirected, this key MUST report the initial requested URL. This key
968
+ * MUST be reported on events of type `rr` (response received).
969
+ *
970
+ * String
971
+ */
972
+ url?: string;
973
+ };
974
+ //#endregion
975
+ //#region src/Cmcd.d.ts
976
+ /**
977
+ * Common Media Client Data (CMCD) version 2.
978
+ *
979
+ * A standardized set of HTTP request header fields, query string parameters,
980
+ * and event reporting fields for communicating media playback metrics.
981
+ *
982
+ * This type is the intersection of {@link CmcdRequest}, {@link CmcdResponse},
983
+ * and {@link CmcdEvent}, combining all keys from all reporting modes.
984
+ *
985
+ * @see {@link https://cdn.cta.tech/cta/media/media/resources/standards/pdfs/cta-5004-final.pdf|CMCD v1 Spec}
986
+ *
987
+ * @public
988
+ */
989
+ type Cmcd = CmcdRequest & CmcdResponse & CmcdEvent;
990
+ //#endregion
991
+ //#region src/CmcdReportingMode.d.ts
992
+ /**
993
+ * CMCD event mode variable name.
994
+ *
995
+ * @public
996
+ */
997
+ declare const CMCD_EVENT_MODE: "event";
998
+ /**
999
+ * CMCD request mode variable name.
1000
+ *
1001
+ * @public
1002
+ */
1003
+ declare const CMCD_REQUEST_MODE: "request";
1004
+ /**
1005
+ * CMCD reporting mode types.
1006
+ *
1007
+ * @enum
1008
+ *
1009
+ * @public
1010
+ */
1011
+ declare const CmcdReportingMode: {
1012
+ /**
1013
+ * Request mode
1014
+ */
1015
+ readonly REQUEST: typeof CMCD_REQUEST_MODE;
1016
+ /**
1017
+ * Event mode
1018
+ */
1019
+ readonly EVENT: typeof CMCD_EVENT_MODE;
733
1020
  };
1021
+ /**
1022
+ * @public
1023
+ */
1024
+ type CmcdReportingMode = ValueOf<typeof CmcdReportingMode>;
1025
+ //#endregion
1026
+ //#region src/CmcdFormatterOptions.d.ts
1027
+ /**
1028
+ * Options for formatting CMCD data values.
1029
+ *
1030
+ * @public
1031
+ */
1032
+ type CmcdFormatterOptions = {
1033
+ /**
1034
+ * The version of the CMCD specification to use.
1035
+ */
1036
+ version: number;
1037
+ /**
1038
+ * The reporting mode to use.
1039
+ */
1040
+ reportingMode: CmcdReportingMode;
1041
+ /**
1042
+ * The base URL to use for relative URLs.
1043
+ */
1044
+ baseUrl?: string;
1045
+ };
1046
+ //#endregion
1047
+ //#region src/CmcdValue.d.ts
1048
+ /**
1049
+ * CMCD Value
1050
+ *
1051
+ * @public
1052
+ */
1053
+ type CmcdValue = ValueOf<Cmcd>;
734
1054
  //#endregion
735
- //#region src/CmcdResponse.d.ts
1055
+ //#region src/CmcdFormatter.d.ts
736
1056
  /**
737
- * CMCD Response Mode.
1057
+ * A formatter for CMCD values.
1058
+ *
1059
+ * @param value - The value to format.
738
1060
  *
739
- * Defines the keys for the CMCD (Common Media Client Data) v2 Response group.
1061
+ * @returns The formatted value.
740
1062
  *
741
1063
  * @public
742
1064
  */
743
- type CmcdResponse = CmcdRequest & {
744
- /**
745
- * Response code for object request (response mode)
746
- *
747
- * The response code received when requesting a media object. In a redirect scenario, this would be the final response code received.
748
- * A value of 0 SHOULD be used to indicate that a response was not received.
749
- *
750
- * Integer
751
- */
752
- rc?: number;
1065
+ type CmcdFormatter = (value: CmcdValue, options: CmcdFormatterOptions) => ValueOrArray<number | SfItem<number>> | ValueOrArray<string | SfItem<string>>;
1066
+ //#endregion
1067
+ //#region src/CmcdV1.d.ts
1068
+ /**
1069
+ * CMCD Version 1
1070
+ *
1071
+ * @public
1072
+ */
1073
+ type CmcdV1 = {
753
1074
  /**
754
- * Time to first byte (ms; response mode)
1075
+ * Buffer length
755
1076
  *
756
- * The elapsed time between when the request was first initiated (captured in ts) and the time when the first byte of the response was received.
757
- * This value should only be reported if it is known. Absence of this key does not indicate that the response was not received.
1077
+ * The buffer length associated with the media object being requested. This value MUST be rounded to the nearest 100 ms. This key SHOULD only be
1078
+ * sent with an object type of ‘a’, ‘v’ or ‘av’.
758
1079
  *
759
1080
  * Integer milliseconds
760
1081
  */
761
- ttfb?: number;
1082
+ bl?: number;
762
1083
  /**
763
- * Time to first body byte (ms; response mode)
1084
+ * Bitrate
764
1085
  *
765
- * The elapsed time between when the request was first initiated (captured in ts) and the time the first bytes of the response body are received.
766
- * This value should only be reported if it is known. Absence of this key does not indicate that the body was not received.
767
- *
768
- * Integer milliseconds
1086
+ * Integer
769
1087
  */
770
- ttfbb?: number;
1088
+ br?: number;
771
1089
  /**
772
- * Time to last byte (ms; response mode)
1090
+ * Measured mtp CMCD throughput
773
1091
  *
774
- * The elapsed time between when the request was first initiated (captured in ts) and the time the response body is fully received.
775
- * This value should only be reported if it is known.
776
- * Absence of this key does not indicate that the response was not fully received
1092
+ * The throughput between client and server, as measured by the client and MUST be rounded to the nearest 100 kbps. This value, however derived,
1093
+ * SHOULD be the value that the client is using to make its next Adaptive Bitrate switching decision. If the client is connected to multiple
1094
+ * servers concurrently, it must take care to report only the throughput measured against the receiving server. If the client has multiple concurrent
1095
+ * connections to the server, then the intent is that this value communicates the aggregate throughput the client sees across all those connections.
777
1096
  *
778
- * Integer milliseconds
1097
+ * Integer kbps
779
1098
  */
780
- ttlb?: number;
1099
+ mtp?: number;
781
1100
  /**
782
- * Requested URL (string; response mode)
1101
+ * Next object request
783
1102
  *
784
- * The URL used to request the media object.
785
- * This key MUST NOT be used with reporting mode #1.
786
- * If the request is redirected, this key MUST report the initial requested URL.
1103
+ * Relative path of the next object to be requested. This can be used to trigger pre-fetching by the CDN. This MUST be a path relative to the current
1104
+ * request. This string MUST be URLEncoded. The client SHOULD NOT depend upon any pre-fetch action being taken - it is merely a request for such a
1105
+ * pre-fetch to take place.
787
1106
  *
788
1107
  * String
789
1108
  */
790
- url?: string;
1109
+ nor?: string;
791
1110
  /**
792
- * CMSD Dynamic Header (response mode)
1111
+ * Next range request
793
1112
  *
794
- * Holds a Base64 [base64] encoded copy of the CMSD data received on the CMSD-Dynamic response header.
795
- * This key MUST only be used in RESPONSE mode.
1113
+ * @deprecated Use 'nor' with the 'r' parameter instead.
796
1114
  *
797
1115
  * String
798
1116
  */
799
- cmsdd?: string;
1117
+ nrr?: string;
800
1118
  /**
801
- * CMSD Static Header (response mode)
1119
+ * Top bitrate
802
1120
  *
803
- * Holds a Base64 [base64] encoded copy of the CMSD data received on the CMSD-Static response header.
804
- * This key MUST only be used in RESPONSE mode.
1121
+ * The highest bitrate rendition in the manifest or playlist that the client is allowed to play, given current codec, licensing and
1122
+ * sizing constraints.
805
1123
  *
806
- * String
807
- */
808
- cmsds?: string;
809
- /**
810
- * SMRT Header
811
-
812
- * Holds a Base64 [base64] encoded copy of the streaming media response tracing data received on the SMRT-Data header.
813
- * This key MUST only be used in RESPONSE mode.
1124
+ * Integer Kbps
814
1125
  */
815
- smrt?: number;
1126
+ tb?: number;
816
1127
  };
817
1128
  //#endregion
818
- //#region src/CmcdData.d.ts
819
- /**
820
- * All CMCD data types combined.
821
- *
822
- * @public
823
- */
824
- type CmcdData = Cmcd & CmcdRequest & CmcdEvent & CmcdResponse;
825
- //#endregion
826
1129
  //#region src/CmcdKey.d.ts
827
1130
  /**
828
- * A CMCD key.
1131
+ * A CMCD key including V1-only keys.
829
1132
  *
830
1133
  * @public
831
1134
  */
832
- type CmcdKey = keyof CmcdData;
1135
+ type CmcdKey = keyof Cmcd | keyof CmcdV1;
833
1136
  //#endregion
834
1137
  //#region src/CmcdFormatterMap.d.ts
835
1138
  /**
@@ -839,39 +1142,31 @@ type CmcdKey = keyof CmcdData;
839
1142
  */
840
1143
  type CmcdFormatterMap = Record<CmcdKey, CmcdFormatter>;
841
1144
  //#endregion
842
- //#region src/CMCD_OBJECT.d.ts
1145
+ //#region src/CmcdHeaderField.d.ts
843
1146
  /**
844
1147
  * CMCD object header name.
845
1148
  *
846
1149
  * @public
847
1150
  */
848
- declare const CMCD_OBJECT = "CMCD-Object";
849
- //#endregion
850
- //#region src/CMCD_REQUEST.d.ts
1151
+ declare const CMCD_OBJECT: "CMCD-Object";
851
1152
  /**
852
1153
  * CMCD request header name.
853
1154
  *
854
1155
  * @public
855
1156
  */
856
- declare const CMCD_REQUEST = "CMCD-Request";
857
- //#endregion
858
- //#region src/CMCD_SESSION.d.ts
1157
+ declare const CMCD_REQUEST: "CMCD-Request";
859
1158
  /**
860
1159
  * CMCD session header name.
861
1160
  *
862
1161
  * @public
863
1162
  */
864
- declare const CMCD_SESSION = "CMCD-Session";
865
- //#endregion
866
- //#region src/CMCD_STATUS.d.ts
1163
+ declare const CMCD_SESSION: "CMCD-Session";
867
1164
  /**
868
1165
  * CMCD status header name.
869
1166
  *
870
1167
  * @public
871
1168
  */
872
- declare const CMCD_STATUS = "CMCD-Status";
873
- //#endregion
874
- //#region src/CmcdHeaderField.d.ts
1169
+ declare const CMCD_STATUS: "CMCD-Status";
875
1170
  /**
876
1171
  * CMCD header fields.
877
1172
  *
@@ -990,17 +1285,9 @@ declare function appendCmcdHeaders(headers: Record<string, string>, cmcd: Cmcd,
990
1285
  */
991
1286
  declare function appendCmcdQuery(url: string, cmcd: Cmcd, options?: CmcdEncodeOptions): string;
992
1287
  //#endregion
993
- //#region src/CMCD_COMMON_KEYS.d.ts
994
- /**
995
- * Defines the common keys for CMCD (Common Media Client Data) version 2.
996
- *
997
- * @public
998
- */
999
- declare const CMCD_COMMON_KEYS: readonly ["ab", "bg", "bl", "br", "bs", "bsd", "cdn", "cid", "cs", "df", "ec", "lab", "lb", "ltc", "msd", "mtp", "pb", "pr", "pt", "sf", "sid", "sn", "st", "sta", "tab", "tb", "tbl", "tpb", "ts", "v"];
1000
- //#endregion
1001
1288
  //#region src/CMCD_DEFAULT_TIME_INTERVAL.d.ts
1002
1289
  /**
1003
- * The default time interval in secondswhen using using event mode
1290
+ * The default time interval in seconds when using using event mode
1004
1291
  *
1005
1292
  * @public
1006
1293
  */
@@ -1012,7 +1299,7 @@ declare const CMCD_DEFAULT_TIME_INTERVAL = 30;
1012
1299
  *
1013
1300
  * @public
1014
1301
  */
1015
- declare const CMCD_EVENT_KEYS: readonly ["e"];
1302
+ declare const CMCD_EVENT_KEYS: readonly ["cen", "e", "h", "ts"];
1016
1303
  //#endregion
1017
1304
  //#region src/CMCD_FORMATTER_MAP.d.ts
1018
1305
  /**
@@ -1022,100 +1309,190 @@ declare const CMCD_EVENT_KEYS: readonly ["e"];
1022
1309
  */
1023
1310
  declare const CMCD_FORMATTER_MAP: Record<string, CmcdFormatter>;
1024
1311
  //#endregion
1025
- //#region src/CMCD_HEADERS.d.ts
1312
+ //#region src/CMCD_KEYS.d.ts
1026
1313
  /**
1027
- * CMCD `headers` transmission mode.
1314
+ * A list of all CMCD keys.
1028
1315
  *
1029
1316
  * @public
1030
1317
  */
1031
- declare const CMCD_HEADERS = "headers";
1318
+ declare const CMCD_KEYS: CmcdKey[];
1032
1319
  //#endregion
1033
- //#region src/CMCD_JSON.d.ts
1320
+ //#region src/CMCD_PARAM.d.ts
1034
1321
  /**
1035
- * CMCD `json` transmission mode.
1322
+ * CMCD parameter name.
1036
1323
  *
1037
1324
  * @public
1325
+ */
1326
+ declare const CMCD_PARAM = "CMCD";
1327
+ //#endregion
1328
+ //#region src/CMCD_REQUEST_KEYS.d.ts
1329
+ /**
1330
+ * Defines the request-specific keys for CMCD (Common Media Client Data) version 2.
1038
1331
  *
1039
- * @deprecated JSON transmission mode is deprecated and will be removed in future versions.
1332
+ * @public
1040
1333
  */
1041
- declare const CMCD_JSON = "json";
1334
+ declare const CMCD_REQUEST_KEYS: readonly ["ab", "bg", "bl", "br", "bs", "bsa", "bsd", "bsda", "cdn", "cid", "cs", "d", "dfa", "dl", "ec", "lab", "lb", "ltc", "msd", "mtp", "nor", "nr", "ot", "pb", "pr", "pt", "rtp", "sf", "sid", "sn", "st", "sta", "su", "tab", "tb", "tbl", "tpb", "v"];
1042
1335
  //#endregion
1043
- //#region src/CMCD_KEYS.d.ts
1336
+ //#region src/CMCD_RESPONSE_KEYS.d.ts
1044
1337
  /**
1045
- * A list of all CMCD keys.
1338
+ * CMCD v2 - Response-only and timing keys.
1046
1339
  *
1047
1340
  * @public
1048
1341
  */
1049
- declare const CMCD_KEYS: CmcdKey[];
1342
+ declare const CMCD_RESPONSE_KEYS: readonly ["cmsdd", "cmsds", "rc", "smrt", "ttfb", "ttfbb", "ttlb", "url"];
1050
1343
  //#endregion
1051
- //#region src/CMCD_PARAM.d.ts
1344
+ //#region src/CMCD_V1.d.ts
1052
1345
  /**
1053
- * CMCD parameter name.
1346
+ * CMCD Version 1
1054
1347
  *
1055
1348
  * @public
1056
1349
  */
1057
- declare const CMCD_PARAM = "CMCD";
1350
+ declare const CMCD_V1: 1;
1058
1351
  //#endregion
1059
- //#region src/CMCD_QUERY.d.ts
1352
+ //#region src/CMCD_V1_KEYS.d.ts
1060
1353
  /**
1061
- * CMCD `query` transmission mode.
1354
+ * Defines the keys for CMCD (Common Media Client Data) version 1.
1062
1355
  *
1063
1356
  * @public
1064
1357
  */
1065
- declare const CMCD_QUERY = "query";
1358
+ declare const CMCD_V1_KEYS: readonly ["bl", "br", "bs", "cid", "d", "dl", "mtp", "nor", "nrr", "ot", "pr", "rtp", "sf", "sid", "st", "su", "tb", "v"];
1066
1359
  //#endregion
1067
- //#region src/CMCD_REQUEST_KEYS.d.ts
1360
+ //#region src/CMCD_V2.d.ts
1068
1361
  /**
1069
- * Defines the request-specific keys for CMCD (Common Media Client Data) version 2.
1362
+ * CMCD Version 2
1070
1363
  *
1071
1364
  * @public
1072
1365
  */
1073
- declare const CMCD_REQUEST_KEYS: readonly ["d", "dl", "nor", "ot", "rtp", "su"];
1366
+ declare const CMCD_V2: 2;
1074
1367
  //#endregion
1075
- //#region src/CMCD_RESPONSE_KEYS.d.ts
1368
+ //#region src/CmcdVersion.d.ts
1076
1369
  /**
1077
- * CMCD v2 - Response-only and timing keys.
1370
+ * The version of the CMCD specification.
1078
1371
  *
1079
1372
  * @public
1080
1373
  */
1081
- declare const CMCD_RESPONSE_KEYS: readonly ["cmsdd", "cmsds", "rc", "smrt", "ttfb", "ttfbb", "ttlb", "url"];
1374
+ type CmcdVersion = typeof CMCD_V1 | typeof CMCD_V2;
1082
1375
  //#endregion
1083
- //#region src/CMCD_RESPONSE_MODE.d.ts
1376
+ //#region src/CmcdReportConfig.d.ts
1084
1377
  /**
1085
- * CMCD response mode variable name.
1378
+ * Configuration for a CMCD report.
1086
1379
  *
1087
1380
  * @public
1088
1381
  */
1089
- declare const CMCD_RESPONSE_MODE = "response";
1382
+ type CmcdReportConfig = {
1383
+ /**
1384
+ * The version of the CMCD specification to use.
1385
+ *
1386
+ * @defaultValue `CMCD_V2`
1387
+ */
1388
+ version?: CmcdVersion;
1389
+ /**
1390
+ * The list of CMCD keys to include in the report. If not provided,
1391
+ * no keys will be reported, unless there are other configuration
1392
+ * options that require keys to be reported, specifically in event mode.
1393
+ *
1394
+ * @defaultValue `undefined`
1395
+ */
1396
+ enabledKeys?: CmcdKey[];
1397
+ };
1090
1398
  //#endregion
1091
- //#region src/CMCD_V1.d.ts
1399
+ //#region src/CmcdEventReportConfig.d.ts
1092
1400
  /**
1093
- * CMCD Version 1
1401
+ * Configuration for a CMCD event report.
1402
+ *
1403
+ * @public
1404
+ */
1405
+ type CmcdEventReportConfig = CmcdReportConfig & {
1406
+ /**
1407
+ * The version of the CMCD protocol to use. Must be
1408
+ * version 2 or higher for event reporting.
1409
+ *
1410
+ * @defaultValue `CMCD_V2`
1411
+ */
1412
+ version?: typeof CMCD_V2;
1413
+ /**
1414
+ * The URL to which the CMCD event should be sent.
1415
+ */
1416
+ url: string;
1417
+ /**
1418
+ * The events to report. If no events are provided,
1419
+ * the event target will be effectively disabled.
1420
+ *
1421
+ * @defaultValue `undefined`
1422
+ */
1423
+ events?: CmcdEventType[];
1424
+ /**
1425
+ * When the time interval event is sent, the interval at which the
1426
+ * events should be reported as a number of seconds.
1427
+ *
1428
+ * @defaultValue `CMCD_DEFAULT_TIME_INTERVAL`
1429
+ *
1430
+ * @see {@link CMCD_DEFAULT_TIME_INTERVAL}
1431
+ */
1432
+ interval?: number;
1433
+ /**
1434
+ * The number of events to batch before sending the report.
1435
+ *
1436
+ * @defaultValue `1`
1437
+ */
1438
+ batchSize?: number;
1439
+ };
1440
+ //#endregion
1441
+ //#region src/CmcdRequestKey.d.ts
1442
+ /**
1443
+ * A CMCD request key.
1094
1444
  *
1095
1445
  * @public
1096
1446
  */
1097
- declare const CMCD_V1 = 1;
1447
+ type CmcdRequestKey = keyof CmcdRequest | "nrr";
1098
1448
  //#endregion
1099
- //#region src/CMCD_V1_KEYS.d.ts
1449
+ //#region src/CMCD_HEADER_MAP.d.ts
1100
1450
  /**
1101
- * Defines the keys for CMCD (Common Media Client Data) version 1.
1451
+ * The map of CMCD keys to their appropriate header shard.
1452
+ *
1453
+ * @internal
1454
+ */
1455
+ declare const CMCD_HEADER_MAP: Record<CmcdRequestKey | "nrr", CmcdHeaderField>;
1456
+ //#endregion
1457
+ //#region src/CmcdHeaderKey.d.ts
1458
+ /**
1459
+ * A CMCD header key.
1102
1460
  *
1103
1461
  * @public
1104
1462
  */
1105
- declare const CMCD_V1_KEYS: readonly ["bl", "br", "bs", "cid", "d", "dl", "mtp", "nor", "nrr", "ot", "pr", "rtp", "sf", "sid", "st", "su", "tb", "v"];
1463
+ type CmcdHeaderKey = keyof typeof CMCD_HEADER_MAP;
1106
1464
  //#endregion
1107
- //#region src/CMCD_V2.d.ts
1465
+ //#region src/CmcdHeaderValue.d.ts
1108
1466
  /**
1109
- * CMCD Version 2
1467
+ * CMCD header value
1110
1468
  *
1111
1469
  * @public
1112
1470
  */
1113
- declare const CMCD_V2 = 2;
1471
+ type CmcdHeaderValue = CmcdRequest | CmcdV1;
1114
1472
  //#endregion
1115
1473
  //#region src/CmcdTransmissionMode.d.ts
1116
1474
  /**
1117
- * CMCD transmission modes.
1475
+ * CMCD `query` transmission mode.
1118
1476
  *
1477
+ * @public
1478
+ */
1479
+ declare const CMCD_QUERY: "query";
1480
+ /**
1481
+ * CMCD `headers` transmission mode.
1482
+ *
1483
+ * @public
1484
+ */
1485
+ declare const CMCD_HEADERS: "headers";
1486
+ /**
1487
+ * CMCD `json` transmission mode.
1488
+ *
1489
+ * @public
1490
+ *
1491
+ * @deprecated JSON transmission mode is deprecated and will be removed in future versions.
1492
+ */
1493
+ declare const CMCD_JSON: "json";
1494
+ /**
1495
+ * CMCD transmission modes.
1119
1496
  *
1120
1497
  * @enum
1121
1498
  *
@@ -1142,85 +1519,127 @@ declare const CmcdTransmissionMode: {
1142
1519
  */
1143
1520
  type CmcdTransmissionMode = ValueOf<typeof CmcdTransmissionMode>;
1144
1521
  //#endregion
1145
- //#region src/CmcdEncoding.d.ts
1522
+ //#region src/CmcdRequestReportConfig.d.ts
1146
1523
  /**
1147
- * CMCD encoding types.
1524
+ * Configuration for a CMCD request report.
1148
1525
  *
1149
- *
1150
- * @enum
1151
- *
1152
- * @public
1153
- *
1154
- * @deprecated Use {@link CmcdTransmissionMode} instead.
1155
- *
1156
- * @see {@link CmcdTransmissionMode}
1157
- */
1158
- declare const CmcdEncoding: typeof CmcdTransmissionMode;
1159
- /**
1160
1526
  * @public
1161
1527
  */
1162
- type CmcdEncoding = ValueOf<typeof CmcdEncoding>;
1163
- //#endregion
1164
- //#region src/CmcdFormatters.d.ts
1165
- /**
1166
- * The default formatters for CMCD values.
1167
- *
1168
- * @public
1169
- *
1170
- * @deprecated Use `CMCD_FORMATTER_MAP` instead.
1171
- */
1172
- declare const CmcdFormatters: Record<string, CmcdFormatter>;
1528
+ type CmcdRequestReportConfig = CmcdReportConfig & {
1529
+ /**
1530
+ * The transmission mode to use.
1531
+ *
1532
+ * @defaultValue `CmcdTransmissionMode.QUERY`
1533
+ */
1534
+ transmissionMode?: CmcdTransmissionMode;
1535
+ };
1173
1536
  //#endregion
1174
- //#region src/CmcdHeadersMap.d.ts
1537
+ //#region src/CmcdReporterConfig.d.ts
1175
1538
  /**
1176
- * A map of CMCD header fields to CMCD keys.
1539
+ * Configuration for a CMCD reporting component.
1177
1540
  *
1178
1541
  * @public
1179
- *
1180
- * @deprecated Use `CmcdHeaderMap` instead.
1181
1542
  */
1182
- type CmcdHeadersMap = Record<CmcdHeaderField, CmcdKey[]>;
1543
+ type CmcdReporterConfig = CmcdRequestReportConfig & {
1544
+ /**
1545
+ * The session ID. If not provided, a new random session ID will be generated.
1546
+ *
1547
+ * @defaultValue `undefined`
1548
+ */
1549
+ sid?: string;
1550
+ /**
1551
+ * The content ID.
1552
+ *
1553
+ * @defaultValue `undefined`
1554
+ */
1555
+ cid?: string;
1556
+ /**
1557
+ * The event configurations. If not provided, no events will be reported.
1558
+ *
1559
+ * @defaultValue `undefined`
1560
+ */
1561
+ eventTargets?: CmcdEventReportConfig[];
1562
+ };
1183
1563
  //#endregion
1184
- //#region src/CmcdReportTarget.d.ts
1564
+ //#region src/CmcdReporter.d.ts
1185
1565
  /**
1186
- * A CMCD report target configuration.
1566
+ * The CMCD reporter.
1187
1567
  *
1188
1568
  * @public
1189
1569
  */
1190
- type CmcdReportTarget = {
1570
+ declare class CmcdReporter {
1571
+ private data;
1572
+ private config;
1573
+ private requestEncodingOptions;
1574
+ private msd;
1575
+ private eventTargets;
1576
+ private requestTarget;
1577
+ private requester;
1578
+ /**
1579
+ * Creates a new CMCD reporter.
1580
+ *
1581
+ * @param config - The configuration for the CMCD reporter.
1582
+ * @param requester - The function to use to send the request.
1583
+ * The default is a simple wrapper around the
1584
+ * native `fetch` API.
1585
+ */
1586
+ constructor(config: Partial<CmcdReporterConfig>, requester?: (request: Request) => Promise<{
1587
+ status: number;
1588
+ }>);
1191
1589
  /**
1192
- * The URL to which the CMCD report should be sent.
1590
+ * Starts the CMCD reporter. Called by the player when the reporter is enabled.
1193
1591
  */
1194
- url: string;
1592
+ start(): void;
1593
+ /**
1594
+ * Stops the CMCD reporter. Called by the player when the reporter is disabled.
1595
+ */
1596
+ stop(): void;
1597
+ /**
1598
+ * Forces the sending of all event reports, regardless of the batch size or interval.
1599
+ * Useful for sending outstanding reports when the player is destroyed or a playback
1600
+ * session ends.
1601
+ */
1602
+ flush(): void;
1195
1603
  /**
1196
- * The reporting mode for the CMCD report.
1604
+ * Updates the CMCD data. Called by the player when the data changes.
1197
1605
  *
1198
- * @defaultValue `CmcdReportingMode.REQUEST`
1606
+ * @param data - The data to update.
1199
1607
  */
1200
- reportingMode?: CmcdReportingMode;
1608
+ update(data: Partial<Cmcd>): void;
1201
1609
  /**
1202
- * The HTTP method to use for the CMCD report.
1610
+ * Records an event. Called by the player when an event occurs.
1203
1611
  *
1204
- * @defaultValue `'GET'`
1612
+ * @param type - The type of event to record.
1613
+ * @param data - Additional data to record with the event. This is
1614
+ * the same as calling `update()` with the same data.
1205
1615
  */
1206
- method?: "GET" | "POST";
1616
+ recordEvent(type: CmcdEventType, data?: Partial<Cmcd>): void;
1207
1617
  /**
1208
- * The version of the CMCD report.
1618
+ * Applies the CMCD request report data to the request. Called by the player
1619
+ * before sending the request.
1209
1620
  *
1210
- * @defaultValue `1`
1621
+ * @param req - The request to apply the CMCD request report to.
1622
+ * @returns The request with the CMCD request report applied.
1211
1623
  */
1212
- version?: number;
1624
+ applyRequestReport(req: Request): Request;
1213
1625
  /**
1214
- * The transmission mode for the CMCD report.
1626
+ * Processes the event targets. Called by the reporter when an event occurs.
1215
1627
  *
1216
- * @defaultValue `CmcdTransmissionMode.QUERY`
1628
+ * @param flush - Whether to flush the event targets.
1217
1629
  */
1218
- transmissionMode?: CmcdTransmissionMode;
1630
+ private processEventTargets;
1219
1631
  /**
1220
- * The list of CMCD keys to include in the report.
1632
+ * Sends an event report. Called by the reporter when a batch is ready to be sent.
1633
+ *
1634
+ * @param target - The target to send the event report to.
1635
+ * @param data - The data to send in the event report.
1221
1636
  */
1222
- enabledKeys?: CmcdKey[];
1223
- };
1637
+ private sendEventReport;
1638
+ /**
1639
+ * Resets the session related data. Called when the session ID changes.
1640
+ */
1641
+ private resetSession;
1642
+ }
1224
1643
  //#endregion
1225
1644
  //#region src/decodeCmcd.d.ts
1226
1645
  /**
@@ -1235,7 +1654,7 @@ type CmcdReportTarget = {
1235
1654
  * @example
1236
1655
  * {@includeCode ../test/decodeCmcd.test.ts#example}
1237
1656
  */
1238
- declare function decodeCmcd<T extends CmcdData = CmcdData>(cmcd: string): T;
1657
+ declare function decodeCmcd<T extends Cmcd = Cmcd>(cmcd: string): T;
1239
1658
  //#endregion
1240
1659
  //#region src/encodeCmcd.d.ts
1241
1660
  /**
@@ -1251,7 +1670,7 @@ declare function decodeCmcd<T extends CmcdData = CmcdData>(cmcd: string): T;
1251
1670
  * @example
1252
1671
  * {@includeCode ../test/encodeCmcd.test.ts#example}
1253
1672
  */
1254
- declare function encodeCmcd(cmcd: CmcdData, options?: CmcdEncodeOptions): string;
1673
+ declare function encodeCmcd(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
1255
1674
  //#endregion
1256
1675
  //#region src/fromCmcdHeaders.d.ts
1257
1676
  /**
@@ -1266,7 +1685,7 @@ declare function encodeCmcd(cmcd: CmcdData, options?: CmcdEncodeOptions): string
1266
1685
  * @example
1267
1686
  * {@includeCode ../test/fromCmcdHeaders.test.ts#example}
1268
1687
  */
1269
- declare function fromCmcdHeaders(headers: Record<string, string> | Headers): CmcdData;
1688
+ declare function fromCmcdHeaders(headers: Record<string, string> | Headers): Cmcd;
1270
1689
  //#endregion
1271
1690
  //#region src/fromCmcdQuery.d.ts
1272
1691
  /**
@@ -1309,7 +1728,7 @@ declare function fromCmcdUrl(url: string): Cmcd;
1309
1728
  *
1310
1729
  * @public
1311
1730
  */
1312
- declare function groupCmcdHeaders(cmcd: CmcdData, customHeaderMap?: Partial<CmcdHeaderMap>): Record<CmcdHeaderField, CmcdData>;
1731
+ declare function groupCmcdHeaders(cmcd: Cmcd, customHeaderMap?: Partial<CmcdHeaderMap>): Record<CmcdHeaderField, CmcdHeaderValue>;
1313
1732
  //#endregion
1314
1733
  //#region src/isCmcdCustomKey.d.ts
1315
1734
  /**
@@ -1336,7 +1755,7 @@ declare function isCmcdCustomKey(key: CmcdKey): boolean;
1336
1755
  * @example
1337
1756
  * {@includeCode ../test/isCmcdEventKey.test.ts#example}
1338
1757
  */
1339
- declare function isCmcdEventKey(key: string): key is keyof CmcdEvent;
1758
+ declare function isCmcdEventKey(key: string): key is keyof Cmcd;
1340
1759
  //#endregion
1341
1760
  //#region src/isCmcdRequestKey.d.ts
1342
1761
  /**
@@ -1351,7 +1770,7 @@ declare function isCmcdEventKey(key: string): key is keyof CmcdEvent;
1351
1770
  * @example
1352
1771
  * {@includeCode ../test/isCmcdRequestKey.test.ts#example}
1353
1772
  */
1354
- declare function isCmcdRequestKey(key: string): key is keyof CmcdRequest;
1773
+ declare function isCmcdRequestKey(key: string): key is keyof Cmcd;
1355
1774
  //#endregion
1356
1775
  //#region src/isCmcdResponseReceivedKey.d.ts
1357
1776
  /**
@@ -1361,14 +1780,12 @@ declare function isCmcdRequestKey(key: string): key is keyof CmcdRequest;
1361
1780
  *
1362
1781
  * @returns `true` if the key is a valid CMCD request key, `false` otherwise.
1363
1782
  *
1364
- * @group CMCD
1365
- *
1366
1783
  * @public
1367
1784
  *
1368
1785
  * @example
1369
- * {@includeCode ../../test/cmcd/isCmcdResponseReceivedKey.test.ts#example}
1786
+ * {@includeCode ../test/isCmcdResponseReceivedKey.test.ts#example}
1370
1787
  */
1371
- declare function isCmcdResponseReceivedKey(key: string): key is keyof CmcdResponse;
1788
+ declare function isCmcdResponseReceivedKey(key: string): key is keyof Cmcd;
1372
1789
  //#endregion
1373
1790
  //#region src/isCmcdV1Key.d.ts
1374
1791
  /**
@@ -1383,7 +1800,7 @@ declare function isCmcdResponseReceivedKey(key: string): key is keyof CmcdRespon
1383
1800
  * @example
1384
1801
  * {@includeCode ../test/isCmcdV1Key.test.ts#example}
1385
1802
  */
1386
- declare function isCmcdV1Key(key: string): key is keyof Cmcd;
1803
+ declare function isCmcdV1Key(key: string): key is CmcdKey;
1387
1804
  //#endregion
1388
1805
  //#region src/prepareCmcdData.d.ts
1389
1806
  /**
@@ -1394,7 +1811,7 @@ declare function isCmcdV1Key(key: string): key is keyof Cmcd;
1394
1811
  *
1395
1812
  * @public
1396
1813
  */
1397
- declare function prepareCmcdData(obj: Record<string, any>, options?: CmcdEncodeOptions): CmcdData;
1814
+ declare function prepareCmcdData(obj: Record<string, any>, options?: CmcdEncodeOptions): Cmcd;
1398
1815
  //#endregion
1399
1816
  //#region src/toCmcdHeaders.d.ts
1400
1817
  /**
@@ -1410,22 +1827,7 @@ declare function prepareCmcdData(obj: Record<string, any>, options?: CmcdEncodeO
1410
1827
  * @example
1411
1828
  * {@includeCode ../test/toCmcdHeaders.test.ts#example}
1412
1829
  */
1413
- declare function toCmcdHeaders(cmcd: CmcdData, options?: CmcdEncodeOptions): Record<CmcdHeaderField, string>;
1414
- //#endregion
1415
- //#region src/toCmcdJson.d.ts
1416
- /**
1417
- * Convert a CMCD data object to JSON.
1418
- *
1419
- * @param cmcd - The CMCD object to convert.
1420
- * @param options - Options for encoding the CMCD object.
1421
- *
1422
- * @returns The CMCD JSON.
1423
- *
1424
- * @public
1425
- *
1426
- * @deprecated Sending CMCD as JSON objects is deprecated. Use `toCmcdUrl` to create an array of url strings instead.
1427
- */
1428
- declare function toCmcdJson(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
1830
+ declare function toCmcdHeaders(cmcd: Cmcd, options?: CmcdEncodeOptions): Record<CmcdHeaderField, string>;
1429
1831
  //#endregion
1430
1832
  //#region src/toCmcdQuery.d.ts
1431
1833
  /**
@@ -1443,24 +1845,6 @@ declare function toCmcdJson(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
1443
1845
  */
1444
1846
  declare function toCmcdQuery(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
1445
1847
  //#endregion
1446
- //#region src/toCmcdReport.d.ts
1447
- /**
1448
- * Converts CMCD data into a report format.
1449
- *
1450
- * @param data - The CMCD data to be transformed into a report
1451
- * @param target - The target configuration for the CMCD report
1452
- *
1453
- * @return A CMCD report object
1454
- *
1455
- * @public
1456
- *
1457
- * @example
1458
- * {@includeCode ../test/toCmcdReport.test.ts#example}
1459
- */
1460
- declare function toCmcdReport(data: CmcdData, target: CmcdReportTarget): Request<{
1461
- cmcd: Cmcd;
1462
- }> | null;
1463
- //#endregion
1464
1848
  //#region src/toCmcdUrl.d.ts
1465
1849
  /**
1466
1850
  * Convert a CMCD data object to a URL encoded string.
@@ -1474,5 +1858,17 @@ declare function toCmcdReport(data: CmcdData, target: CmcdReportTarget): Request
1474
1858
  */
1475
1859
  declare function toCmcdUrl(cmcd: Cmcd, options?: CmcdEncodeOptions): string;
1476
1860
  //#endregion
1477
- export { CMCD_COMMON_KEYS, CMCD_DEFAULT_TIME_INTERVAL, CMCD_EVENT_KEYS, CMCD_EVENT_MODE, CMCD_FORMATTER_MAP, CMCD_HEADERS, CMCD_JSON, CMCD_KEYS, CMCD_OBJECT, CMCD_PARAM, CMCD_QUERY, CMCD_REQUEST, CMCD_REQUEST_KEYS, CMCD_REQUEST_MODE, CMCD_RESPONSE_KEYS, CMCD_RESPONSE_MODE, CMCD_SESSION, CMCD_STATUS, CMCD_V1, CMCD_V1_KEYS, CMCD_V2, Cmcd, CmcdCustomKey, CmcdData, CmcdEncodeOptions, CmcdEncoding, CmcdEvent, CmcdEventExcludedKeys, CmcdEventType, CmcdFormatter, CmcdFormatterMap, CmcdFormatterOptions, CmcdFormatters, CmcdHeaderField, CmcdHeaderMap, CmcdHeadersMap, CmcdKey, CmcdObjectType, CmcdPlayerState, CmcdReportTarget, CmcdReportingMode, CmcdRequest, CmcdResponse, CmcdStreamType, CmcdStreamingFormat, CmcdTransmissionMode, CmcdValue, appendCmcdHeaders, appendCmcdQuery, decodeCmcd, encodeCmcd, fromCmcdHeaders, fromCmcdQuery, fromCmcdUrl, groupCmcdHeaders, isCmcdCustomKey, isCmcdEventKey, isCmcdRequestKey, isCmcdResponseReceivedKey, isCmcdV1Key, prepareCmcdData, toCmcdHeaders, toCmcdJson, toCmcdQuery, toCmcdReport, toCmcdUrl };
1861
+ //#region src/toCmcdValue.d.ts
1862
+ /**
1863
+ * Convert a value to a CMCD value.
1864
+ *
1865
+ * @param value - The value to convert to a CMCD value.
1866
+ * @param params - The parameters to convert to a CMCD value.
1867
+ * @returns The CMCD value.
1868
+ *
1869
+ * @public
1870
+ */
1871
+ declare function toCmcdValue<V extends SfBareItem, P>(value: V, params?: P): SfItem<V, P>;
1872
+ //#endregion
1873
+ export { CMCD_DEFAULT_TIME_INTERVAL, CMCD_EVENT_AD_BREAK_END, CMCD_EVENT_AD_BREAK_START, CMCD_EVENT_AD_END, CMCD_EVENT_AD_START, CMCD_EVENT_BACKGROUNDED_MODE, CMCD_EVENT_BITRATE_CHANGE, CMCD_EVENT_CONTENT_ID, CMCD_EVENT_CUSTOM_EVENT, CMCD_EVENT_ERROR, CMCD_EVENT_KEYS, CMCD_EVENT_MODE, CMCD_EVENT_MUTE, CMCD_EVENT_PLAYER_COLLAPSE, CMCD_EVENT_PLAYER_EXPAND, CMCD_EVENT_PLAY_STATE, CMCD_EVENT_RESPONSE_RECEIVED, CMCD_EVENT_SKIP, CMCD_EVENT_TIME_INTERVAL, CMCD_EVENT_UNMUTE, CMCD_FORMATTER_MAP, CMCD_HEADERS, CMCD_JSON, CMCD_KEYS, CMCD_OBJECT, CMCD_PARAM, CMCD_QUERY, CMCD_REQUEST, CMCD_REQUEST_KEYS, CMCD_REQUEST_MODE, CMCD_RESPONSE_KEYS, CMCD_SESSION, CMCD_STATUS, CMCD_V1, CMCD_V1_KEYS, CMCD_V2, Cmcd, CmcdCustomKey, CmcdCustomValue, CmcdEncodeOptions, CmcdEvent, CmcdEventReportConfig, CmcdEventType, CmcdFormatter, CmcdFormatterMap, CmcdFormatterOptions, CmcdHeaderField, CmcdHeaderKey, CmcdHeaderMap, CmcdHeaderValue, CmcdKey, CmcdObjectType, CmcdObjectTypeList, CmcdPlayerState, CmcdReportConfig, CmcdReporter, CmcdReporterConfig, CmcdReportingMode, CmcdRequest, CmcdRequestKey, CmcdRequestReportConfig, CmcdResponse, CmcdStreamType, CmcdStreamingFormat, CmcdTransmissionMode, CmcdV1, CmcdValue, appendCmcdHeaders, appendCmcdQuery, decodeCmcd, encodeCmcd, fromCmcdHeaders, fromCmcdQuery, fromCmcdUrl, groupCmcdHeaders, isCmcdCustomKey, isCmcdEventKey, isCmcdRequestKey, isCmcdResponseReceivedKey, isCmcdV1Key, prepareCmcdData, toCmcdHeaders, toCmcdQuery, toCmcdUrl, toCmcdValue };
1478
1874
  //# sourceMappingURL=index.d.ts.map