Skip to content

Conversation

@juanmanuel-qualabs
Copy link

@juanmanuel-qualabs juanmanuel-qualabs commented Jun 2, 2025

Description

The PR brings CMCD v2 support with fully-documented type definitions and mode-specific key mappings.
New files are added for each conceptual area of CMCD v2 (Common, Event Mode, Request Mode, Response Mode)
No deletions or breaking changes are present;

Details:

  • lib/src/cmcd/Cmcd.ts: Adds the CMCD_V1_KEYS array listing all CMCD v1 keys, improving v1/v2 separation and documentation.

  • lib/src/cmcd/CMCD_V2.ts: Exports the new CMCD version constant (CMCD_V2 = 2).

  • lib/src/cmcd/CmcdV2.ts: Defines the top-level CmcdV2 type, encompassing all v2 structures (object, request, event, response, reporting event, player state).

  • lib/src/cmcd/CmcdV2Object.ts: Implements the CmcdV2Object type, describing all common CMCD v2 keys (bitrate, buffer lengths, CDN ID, content ID, session ID, error codes, etc.), including detailed JSDoc documentation for each field.

    • Declares the CMCD_V2_COMMON_KEYS array for all relevant CMCD v2 keys.
  • lib/src/cmcd/CmcdV2Request.ts: Introduces CmcdV2Request type for request-specific keys (object duration, deadline, next object request, object type, throughput, startup flag) and the CMCD_V2_REQUEST_MODE_KEYS array.

  • lib/src/cmcd/CmcdV2Response.ts: Adds CmcdV2Response type for response-specific and timing keys (response code, TTFB, TTLB, requested URL, CMSD headers, etc.) and the CMCD_V2_RESPONSE_MODE_KEYS array.

  • lib/src/cmcd/CmcdV2Event.ts: Defines CmcdV2Event type and CMCD_V2_EVENT_MODE_KEYS array for event and event-response keys, including detailed JSDoc for each reporting event token.

  • lib/src/cmcd/CmcdReportingEvent.ts: Enumerates possible CMCD v2 reporting events for the 'e' key (error, time interval, play state change) and defines the CmcdReportingEvent type.

  • lib/src/cmcd/CmcdPlayerState.ts: Lists CMCD v2 player states for the 'sta' key (starting, playing, seeking, rebuffering, paused, waiting, ended, fatal error) and defines the CmcdPlayerState type.

  • lib/src/cmcd/CmcdMode.ts: Introduces CMCD_MODE constant for CMCD modes (request, response, event) and the corresponding CmcdMode type.

@juanmanuel-qualabs juanmanuel-qualabs marked this pull request as ready for review June 3, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants