CML
    Preparing search index...

    Class CmcdReporter

    The CMCD reporter.

    Index

    Constructors

    Methods

    • Creates a new request with the CMCD request report data applied. Called by the player before sending the request.

      Type Parameters

      Parameters

      • request: R

        The request to apply the CMCD request report to.

      • Optionaldata: Partial<Cmcd>

        The data to apply to the request. This data only applies to this request report. Persistent data should be updated using update().

      Returns R & HttpRequest & {
          customData: { cmcd: Cmcd } & R["customData"];
          headers: Record<string, string>;
      }

      The request with the CMCD request report applied.

    • Forces the sending of all event reports, regardless of the batch size or interval. Useful for sending outstanding reports when the player is destroyed or a playback session ends.

      Returns void

    • Checks if the request reporting is enabled.

      Returns boolean

      true if the request reporting is enabled, false otherwise.

    • Records an event. Called by the player when an event occurs.

      Parameters

      • type: CmcdEventType

        The type of event to record.

      • data: Partial<Cmcd> = {}

        Additional data to record with the event. This data only applies to this event report. Persistent data should be updated using update().

      Returns void

    • Records a response-received event. Called by the player when a media request response has been fully received.

      This method automatically derives the rr event keys from the

      • url - the original requested URL (before any redirects)
      • rc - the HTTP response status code
      • ts - the request initiation time (from resourceTiming.startTime)
      • ttfb - time to first byte (from resourceTiming.responseStart)
      • ttlb - time to last byte (from resourceTiming.duration)

      Additional keys like ttfbb, cmsdd, cmsds, and smrt can be supplied via the data parameter if the player has access to them.

      Parameters

      • response: HttpResponse<HttpRequest<{ cmcd?: Cmcd }>>

        The HTTP response received.

      • data: Partial<Cmcd> = {}

        Additional CMCD data to include with the event. Values provided here override any auto-derived values.

      Returns void

    • Starts the CMCD reporter. Called by the player when the reporter is enabled.

      Note: This fires an initial time-interval event immediately (synchronously) before the first interval elapses. Ensure CMCD data (sid, cid, etc.) is populated before calling start().

      Returns void

    • Stops the CMCD reporter. Called by the player when the reporter is disabled.

      Parameters

      • flush: boolean = false

        Whether to flush the event targets.

      Returns void