Common Media Client Data (CMCD) is a CTA-5004 standard for embedding client-side playback metrics in each media request so the origin server or CDN can make informed caching and routing decisions. The WebRTS Client implements CMCD onDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/CeeblueTV/wrts-client/llms.txt
Use this file to discover all available pages before exploring further.
HTTPAdaptiveSource, allowing you to enable telemetry with a single property assignment on the Player or Source instance. The three enums and interface below define what data is sent and how it is delivered.
CMCD Enum
Controls whether CMCD telemetry is enabled and how much data is included in each request.CMCD is disabled. No extra headers or query parameters are added to media requests. This is the default value.
Sends only the essential CMCD keys, omitting verbose fields such as
cid (content ID), dl (deadline), ot (object type), and st (stream type). Use this mode in production to reduce per-request header overhead while retaining useful signal for the CDN.Sends all available CMCD keys on every media request. Useful for development and debugging when you want the complete telemetry picture.
CMCDMode Enum
Controls the transport mechanism used to deliver CMCD data to the server.CMCD data is delivered via structured HTTP request headers (e.g.
CMCD-Request, CMCD-Object, CMCD-Status, CMCD-Session). This is the default mode and is preferred for most deployments because headers are not cached and do not pollute CDN cache keys.CMCD data is delivered by appending a
cmcd=… query parameter to every segment URL. Use this mode when your CDN or proxy cannot read custom request headers but can inspect query strings.ICMCD Interface
ICMCD is the interface implemented by both Player and HTTPAdaptiveSource. Setting any property to undefined resets it to its documented default.
Gets or sets the CMCD reporting level.
- Getter returns the current
CMCDenum value. - Setter accepts a
CMCDvalue orundefined. Settingundefinedresets toCMCD.NONE.
Gets or sets the CMCD delivery mechanism.
- Getter returns the current
CMCDModeenum value. - Setter accepts a
CMCDModevalue orundefined. Settingundefinedresets toCMCDMode.HEADER.
Gets or sets the CMCD session ID (
sid key). The session ID correlates multiple requests belonging to the same playback session.- Getter returns the current session ID string (empty string if unset).
- Setter accepts a
stringorundefined. Settingundefinedresets to''.
Enabling CMCD on a Player
Reading CMCD Settings from URL Parameters
When building a player page that must be configurable via URL, you can pass URL parameters directly to the CMCD setters. Because the setters treatundefined as a reset-to-default signal, missing parameters are handled gracefully without any extra null-checks:
?cmcd=full&cmcdMode=query&cmcdSid=abc enables full CMCD over query string with session ID abc.
CMCD is only supported by
HTTPAdaptiveSource (HLS/DASH adaptive streams). Setting cmcd to any value other than CMCD.NONE on WSSource (WebSocket-based playback) or the abstract Source base class will have no effect or may throw. Check the source type before setting CMCD properties if you are writing code that works with multiple source types.