Files
ShakaPlayer/third_party/cml-cmcd/cmcd_header_field.js
Casey OcchialiniandClaude Code 55e7d35358 feat(cmcd): vendor @svta/cml-cmcd, replace custom encoder + state machine (#10060)
Replace shaka's custom CMCD wire-format encoding and reporting state
machine with a vendored Closure port of @svta/cml-cmcd (v2.4.0) under
third_party/cml-cmcd/. shaka.util.CmcdManager becomes a thin adapter
around CML's spec-conformant encoder and CmcdReporter; its public API
is otherwise unchanged.

Intentional wire-format changes to align with CTA-5004 / CTA-5004-B:
- nor is now root-relative and uses the V2 inner-list format
  (nor=("next.m4v")).
- Non-spec 'ld'/'lh' StreamingFormat values dropped; low-latency DASH
  now emits sf=d and low-latency HLS sf=h.
- V2 output is RFC 8941 SFV-conformant: e/sta are tokens (e=ps, not
  e="ps"), v=2 is always present, and ts is emitted in event mode only
  (dropped from request mode).

Experimental v2 config renamed: targets -> eventTargets and per-target
timeInterval -> interval. Adds public EventType/PlayerState re-exports.

Co-Authored-By: Claude Code (Claude Opus 4.8) <[email protected]>
2026-07-12 10:07:21 -07:00

83 lines
1.5 KiB
JavaScript

/*! @license
* Copyright 2024 Streaming Video Technology Alliance
* SPDX-License-Identifier: Apache-2.0
*/
goog.provide('cml.cmcd.CMCD_HEADER_FIELDS');
goog.provide('cml.cmcd.CMCD_OBJECT');
goog.provide('cml.cmcd.CMCD_REQUEST');
goog.provide('cml.cmcd.CMCD_SESSION');
goog.provide('cml.cmcd.CMCD_STATUS');
goog.provide('cml.cmcd.CmcdHeaderField');
/**
* CMCD object header name.
*
* @const {string}
*/
cml.cmcd.CMCD_OBJECT = 'CMCD-Object';
/**
* CMCD request header name.
*
* @const {string}
*/
cml.cmcd.CMCD_REQUEST = 'CMCD-Request';
/**
* CMCD session header name.
*
* @const {string}
*/
cml.cmcd.CMCD_SESSION = 'CMCD-Session';
/**
* CMCD status header name.
*
* @const {string}
*/
cml.cmcd.CMCD_STATUS = 'CMCD-Status';
/**
* CMCD header fields.
*
* @enum {string}
*/
cml.cmcd.CmcdHeaderField = {
/**
* keys whose values vary with the object being requested.
*/
OBJECT: cml.cmcd.CMCD_OBJECT,
/**
* keys whose values vary with each request.
*/
REQUEST: cml.cmcd.CMCD_REQUEST,
/**
* keys whose values are expected to be invariant over the life of
* the session.
*/
SESSION: cml.cmcd.CMCD_SESSION,
/**
* keys whose values do not vary with every request or object.
*/
STATUS: cml.cmcd.CMCD_STATUS,
};
/**
* All CMCD header fields as an array.
*
* @const {!Array<string>}
*/
cml.cmcd.CMCD_HEADER_FIELDS = [
cml.cmcd.CMCD_OBJECT,
cml.cmcd.CMCD_REQUEST,
cml.cmcd.CMCD_SESSION,
cml.cmcd.CMCD_STATUS,
];