Feature: CMCD v2#4816
Conversation
|
Hi @gorkemg , I just renamed the |
|
Related issue #4507 |
|
@cotid-qualabs |
|
Thank you @Jason239 , I will take a look at this as soon as I can. Good catch! |
|
I have fixed the getCmcdParametersFromManifest function call and included unit test coverage for cmcd implementation on ProtectionController.js |
This reverts commit bf31094.
…validity-expiration Revert "Feature MPD update on validity expiration"
|
Hi @dsilhavy ! All requested changes have been implemented, including removing Response Mode and adding Response Received. However, this implementation depends on Common Media Library "response received" PR (streaming-video-technology-alliance/common-media-library#268) being merged and version 0.18.2 being released. Then I need to update CML version on dash.js |
|
@cotid-qualabs I would like to review this PR for v5.2.0. Can I please ask you to rebase your changes against the latest development branch |
|
Hi @dsilhavy ! Just wanted to let you know that new implementation for CMCDv2 using CML CmcdReporter is almost ready on this Draft PR qualabs#159 . We just need to wait for CML release. |
* cmcd reporter initialization * request mode migration * event mode migration * cmcd model migration * fix cmcd model unit tests * fixes for cmcd parameters and cleanup - protection controller fixes WIP * cleanup and update unit tests * refactor unit tests and fixes * fix unit tests and remove batchTimer
* ab, lab and tab inner list and request mode * ab, tab and lab inner list for v2 * bl inner list and event mode * br inner list and event mode * toInnerList helper * bsd inner list * mtp inner list and event mode * nor inner list * pb inner list and event mode * tp inner list and event mode * tpb inner list and event mode * fix unit tests
* chore: update CML dependencies * fix: update common media request * fix: update resourceTiming properties to use performance.now() * fix: update cmcd data formatting * fix: remove redundant rr values * refactor: simplify cmcd reporting * fix: test mock requests missing parameters * chore: update cml cmcd version * should not send report if events are undefined * fix unit tests --------- Co-authored-by: cotid-qualabs <constanzad@qualabs.com>
|
Related discussion: video-dev/hls.js#7725 |
* feat: add CMCD v2 Playwright E2E tests with spec validation Adds comprehensive E2E tests using Playwright to validate CMCD v2 payloads at the network level during real playback. Uses @svta/cml-cmcd validation functions (validateCmcd, validateCmcdHeaders, validateCmcdEvent, validateCmcdKeys) for spec-level compliance checks across query, header, and event modes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: replace Playwright E2E tests with Karma functional tests for CMCD v2 Replace the Playwright-based E2E test suite with Karma functional tests that use XHR interceptors to validate CMCD v2 spec compliance. This eliminates the @playwright/test dependency (~100MB) while maintaining full test coverage across all three transmission modes (query, header, event), key filtering, and version validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: remove double parsing from CMCD v2 tests CmcdRequestCollector now stores raw CMCD strings instead of pre-parsed objects, removing its dependency on @svta/cml-cmcd entirely. Tests use validation function return values (result.data) for both spec validation and data assertions in a single pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: update cml packages * fix: add logging to xhr collector * refactor: use unified collector and validateCmcdRequest for CMCD v2 tests Rewrite CmcdRequestCollector with a single requests array storing httpRequest objects compatible with CML's validateCmcdRequest(). Replace mode-specific validators (validateCmcd, validateCmcdHeaders) with the unified validateCmcdRequest() and remove the invalid validateCmcdKeys test that was passing a string to a function expecting a parsed object. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
@cotid-qualabs I finally found the time to look into the PR again. Would it be possible to grant me write access to the upstream repo? I will probably want to apply some minor changes to the PR and I think it would be easier if I can add changes to the PR myself rather than putting everything in review comments |
|
Hi @dsilhavy ! Check if you have access now |
Thanks @cotid-qualabs , works :) |
Rename targets->eventTargets, timeInterval->interval, includeOnRequests-> includeInRequests across settings, samples, and tests. Switch event validation to validateCmcdEvents (batch). HTTPLoader now accepts empty POST bodies so CMCD event endpoints don't trigger retries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CMCD v2 Support - Comprehensive Implementation
This Pull Request introduces comprehensive support for CMCD (Common Media Client Data) Version 2, significantly expanding the player's capabilities for media analytics and client-side data reporting. The implementation leverages the
@svta/cml-cmcdlibrary'sCmcdReporterto centralize reporting mechanisms, reducing complexity and improving maintainability while aligning with the latest CMCD specifications.Key Features & Enhancements:
1. CMCD Reporter Integration
CmcdReporterfrom@svta/cml-cmcdlibraryCmcdControllerfocuses on orchestration and configuration, delegating report transmission toCmcdReporterCmcdModelspecializes in calculating CMCD data for requests, with cleaner separation of concerns2. CMCD v2 Specification Adherence
ltc,rc,bg,sta,ttfb,ttlb,ts,url,ec,msd,e,cmsdd,cmsds,df,sn,pb,tpb,bsd,ab,tab,lab3. New CMCD Reporting Modes
event): CMCD data reporting triggered by specific player events or configurable time intervalsps,e,t,rrs,p,k,r,a,w,e,fttfb,ttlb, andrc4. Multiple Reporting Targets & Granular Configuration
streaming.cmcd.targetsarray for configuring multiple CMCD reporting endpointsurl: Destination URL for CMCD reportsmode: Transmission mode (queryorheader)enabledKeys: Specific CMCD keys to include (defaults to only mandatory if not defined)events: Player events that trigger reports (defaults to none if not defined)timeInterval: Interval in seconds for periodic reports (0 disables)includeInRequests: HTTP request types to include CMCD data for5. Enhanced Architecture & Separation of Concerns
CmcdController: Orchestrates CMCD v2 data collection, managesCmcdReporterinstances, and coordinates with interceptorsCmcdModel: Calculates CMCD data for various request types with renamed methods (calculateCmcdDataForRequest) for clarityCmcdReporter)6. Request/Response Interceptors
_cmcdRequestModeInterceptor: Injects CMCD data into outgoing requests (forqueryandheadermodes)_cmcdResponseReceivedInterceptor: Processes incoming responses to gather data and trigger reports7. Batching Mechanism via CmcdReporter
batchSize): Sends batch immediately when count reaches configured size8. Settings Abstraction Layer
CmcdPropertyMap: Declarative configuration mapping logical property names to physical pathsCmcdConfigAccessor: Unified API for CMCD configuration accessget(),has(),getVersion(),isEnabled(),getTargets(),getTarget()Benefits:
9. Common Media Library Integration
@svta/common-media-librarydependencyencodeCmcdfunction for key filtering, whitelisting, and custom key managementCmcdReporterfor standardized reporting across SVTA ecosystem10. New Sample Pages
11. Unit Testing
Main Files Affected:
src/streaming/controllers/CmcdController.js: Refactored to instantiate and manageCmcdReporter, removed manual event/reporting logic, usesCmcdConfigAccessorsrc/streaming/models/CmcdModel.js: Simplified to focus on CMCD data calculation with renamed methods, usesCmcdConfigAccessorsrc/core/Settings.js: Updated with new CMCD v2 configuration options (streaming.cmcd.targets, version selection)src/streaming/cmcd/config/CmcdPropertyMap.js: Declarative configuration for version-aware property mappingssrc/streaming/cmcd/config/CmcdConfigAccessor.js: Abstraction layer providing unified configuration APIpackage.json: Updated dependencies for@svta/cml-cmcdlibrary integrationFuture Work