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]>
27 lines
802 B
JavaScript
27 lines
802 B
JavaScript
/*! @license
|
|
* Copyright 2024 Streaming Video Technology Alliance
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
goog.provide('cml.cmcd.CmcdData');
|
|
|
|
goog.require('cml.cmcd.Cmcd');
|
|
|
|
|
|
/**
|
|
* A CMCD data object that is either version 1 or version 2.
|
|
*
|
|
* The `v` property acts as a discriminator: when `v === 2`, the type
|
|
* narrows to v2 with inner-list values and event/response keys; when
|
|
* `v === 1` or absent, the type narrows to v1 with scalar `bl`/`br`/
|
|
* `mtp`/`tb` and string `nor`.
|
|
*
|
|
* Upstream CML expresses this as `CmcdV1Data | CmcdV2Data`. Closure
|
|
* typedefs cannot express discriminated unions; we widen to the same
|
|
* superset as `cml.cmcd.Cmcd`. Callers must inspect `v` themselves
|
|
* when version-specific narrowing is required.
|
|
*
|
|
* @typedef {cml.cmcd.Cmcd}
|
|
*/
|
|
cml.cmcd.CmcdData;
|