CMCDConfiguration

public struct CMCDConfiguration : Codable, Equatable

Configuration for Common Media Client Data (CMCD) at the player level.

CMCD is a specification (CTA-5004) that defines a standard way for media players to communicate information about playback to CDNs and other infrastructure components.

Currently exposed for event reporting. Configure eventEndpoints to receive CMCD event reports.

Remark

This configuration is set at the player level via THEOplayerConfiguration. For source-level configuration (which can additionally specify a session ID), use CMCDSourceConfiguration.
  • An external session ID that can be used to identify the current playback session.

    This is useful for correlating CMCD data with external analytics systems.

    Declaration

    Swift

    public let externalSessionId: String?
  • A user ID that can be used to identify the user.

    Declaration

    Swift

    public let userId: String?
  • The endpoints where CMCD events should be sent.

    When configured, CMCD events (such as playback state changes, errors, etc.) will be POSTed to these endpoints. These are merged with any source-level endpoints (not overridden).

    Declaration

    Swift

    public let eventEndpoints: [CMCDEndpointConfiguration]?
  • Creates a new CMCD configuration.

    Declaration

    Swift

    public init(
        externalSessionId: String? = nil,
        userId: String? = nil,
        eventEndpoints: [CMCDEndpointConfiguration]? = nil
    )

    Parameters

    externalSessionId

    An external session ID for correlation with external systems. Defaults to nil.

    userId

    A user ID to identify the user. Defaults to nil (auto-generated).

    eventEndpoints

    Endpoints where CMCD events should be sent. Merged with source-level endpoints. Defaults to nil.