React Native THEOplayer

Getting started with CMCD on React Native

Media player clients can transmit useful information to Content Delivery Networks (CDNs) with each object request. This implementation is planned to fully support Common Media Client Data (CMCD) as defined in CTA-5004-B, published in April 2026.

CMCD supports two modes of transmission:

Request mode

To enable CMCD request mode, developers need to explicitly set the transmissionMode parameter inside a SourceDescription.

const source = {
  sources: [ /* ... */ ],
  /* ... */
  cmcd: {
    transmissionMode: CmcdTransmissionMode.SDK_DEFAULT
    /* ... */
  }
} as SourceDescription;
player.source = source;

By specifying the transmissionMode as SDK_DEFAULT, we let each SDK decide which transmission mode to use:

On Web and Android, you can force a specific transmission mode by providing a different value, e.g.

const source = {
  sources: [ /* ... */ ],
  /* ... */
  cmcd: {
    transmissionMode: CmcdTransmissionMode.HTTP_HEADER
    /* ... */
  }
} as SourceDescription;
player.source = source;

On Web, there are additional configuration options. For more details, visit the API references.

Remarks

Event mode

Event mode allows posting CMCD events to configured HTTP endpoints.

:::info Event mode is supported starting from version 11.4.0. :::

Player-level configuration

const player = new THEOplayer.Player(element, {
  cmcd: {
    externalSessionId: 'YOUR-EXTERNAL-SESSION-ID', // optional
    userId: 'YOUR-USER-ID', // optional
    eventEndpoints: [{ url: 'https://example.com/cmcd-event-endpoint' }],
  },
});

Source-level configuration

player.source = {
  sources: [ /* ... */ ],
  /* ... */
  cmcd: {
    externalSessionId: 'YOUR-EXTERNAL-SESSION-ID', // optional
    sessionID: 'YOUR-SESSION-ID', // optional
    userId: 'YOUR-USER-ID', // optional
    eventEndpoints: [{ url: 'https://example.com/cmcd-event-other-endpoint' }],
  },
};

Merging behavior

:::warning Event mode reporting currently only supports DRM and ad events. :::