feat: update @svta/cml-cmcd to 2.4.0 - [Cursor]#6
Conversation
There was a problem hiding this comment.
Pull request overview
Updates dash.js’ CMCD integration and related tests to align with @svta/cml-cmcd 2.4.0, including new/updated CMCD v2 event semantics and functional test tooling.
Changes:
- Bump
@svta/cml-cmcdfrom 2.3.2 to 2.4.0 and update lockfile. - Refactor CMCD controller/model interactions (state updates, error event payload, continuous vs event-mode data paths).
- Modernize functional CMCD v2 tests to use
CmcdReportRecorderand add a dedicated functional streams config for CMCD.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/test/streaming/streaming.controllers.CmcdController.js | Extends unit coverage for CMCD v2 event payloads (e.g., ec) and playback-rate (pr) events. |
| test/functional/test/feature-support/cmcd.js | Removes progressing-state assertion from CMCD functional test flow. |
| test/functional/test/feature-support/cmcd-v2.js | Migrates request/event capture from custom collector to CmcdReportRecorder and updates assertions accordingly. |
| test/functional/helpers/CmcdRequestCollector.js | Removes the now-replaced custom XHR CMCD request collector helper. |
| test/functional/config/test-configurations/streams/cmcd.json | Adds a focused CMCD functional test stream configuration. |
| src/streaming/models/CmcdModel.js | Adds getContinuousCmcdData() and updates CMCD data-generation notes. |
| src/streaming/controllers/CmcdController.js | Refactors reporter updates and event triggering to match the updated CMCD library behavior, including updated ec formatting. |
| package.json | Updates @svta/cml-cmcd dependency version. |
| package-lock.json | Updates @svta/cml-cmcd resolved version/integrity metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function getContinuousCmcdData() { | ||
| const data = getEventModeData(); | ||
| delete data.bg; | ||
| delete data.br; | ||
| return data; | ||
| } |
There was a problem hiding this comment.
Addressed in d22b82c: _getMetricsCmcdData() builds continuous snapshots without calling _getEncodedBitrateData() or setting bg, instead of computing those fields and deleting them on every applyCmcdToRequest refresh.
| for (const evt of events) { | ||
| const contentType = evt.httpRequest.headers['content-type'] || ''; | ||
| const contentType = evt.request.headers['content-type'] || ''; | ||
| expect(contentType).to.include('application/cmcd'); |
There was a problem hiding this comment.
No change needed for this harness: every cmcd-v2.js suite attaches createXhrTransport(), which stores headers as this._cmcdHeaders[name.toLowerCase()] = value in @svta/cml-cmcd@2.4.0. evt.request.headers['content-type'] matches the recorded HttpRequest regardless of the casing dash.js passes to setRequestHeader (Content-Type).
Build continuous reporter snapshots without encoded bitrate or background fields instead of computing and deleting them on every request.
No description provided.