-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Feature: CMCD v2 #4816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cotid-qualabs
wants to merge
251
commits into
Dash-Industry-Forum:development
Choose a base branch
from
qualabs:feature/cmcdv2
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature: CMCD v2 #4816
cotid-qualabs
wants to merge
251
commits into
Dash-Industry-Forum:development
from
qualabs:feature/cmcdv2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…t object with updated properties
Cmcdv2/response mode
Fixed target filter in Event Mode Time Interval Changed HTTP request types for CMCD requests
Cmcdv2/response received
Author
|
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#263 ) being merged and version 0.18.2 being released. Then I need to update CML version on dash.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 changes allow for more granular control over what data is sent, how it's sent, and to where, aligning with the latest CMCD specifications.
Key Features & Enhancements:
CMCD v2 Specification Adherence:
ltc-rc-bg-sta-ttfb-ttlb-ts-url-ec-msd-e-cmsdd-cmsds-df-sn-pb-tpb-bsd-ab-tab-labNew CMCD Reporting Modes:
event): Enables CMCD data reporting triggered by specific player events (e.g., playback state changes, errors) or at configurable time intervals. This allows for real-time or near real-time feedback on player behavior.ps-e-t-rrs-p-k-r-a-w-e-fttfb), Time To Last Byte (ttlb), and response code (rc).Multiple Reporting Targets & Granular Configuration:
streaming.cmcd.targetsarray in the player settings. This allows developers to configure multiple CMCD reporting endpoints.url: The destination URL for the CMCD report.mode: The data transmission mode to use for this target (queryorheader).enabledKeys: A specific list of CMCD keys to include for this target. If not defined, sends all available keys for the target. If the list is empty, no keys are sent.events(for event mode): An array of player events that should trigger a CMCD report. If events is not defined, all available events trigger a CMCD report. If the array is empty, no event-specific CMCD data will be sent.timeInterval(for event mode): The interval in seconds for periodic CMCD reports. If value is 0, periodic reports are disabled.includeInRequests(for request/response received): Specifies which types of HTTP requests (e.g.,manifest,mediaSegmentInit,mediaSegment) should include CMCD data for this target.Refined Orchestration of CMCD data via
CmcdController:CmcdControlleris responsible for orchestrating all CMCD v2 data collection, formatting, and reporting.Refined State Management via
CmcdModel:CmcdModelhas been updated to manage and provide the necessary player and media state for all supported CMCD modes and keys, including new v2 parameters.Request/Response Interceptors:
_cmcdRequestModeInterceptorinjects CMCD data into outgoing requests (forqueryandheadermodes)._cmcdResponseReceivedInterceptorprocesses incoming responses to gather data forresponse receivedand triggers reports.New Sample Pages
CMCD v2 Reportingsample page showcases how to set up CMCD v2 and its new target configurations for each new mode.CMCD v2 Callbacks with Network Interceptorssample page introduces a demonstration of using Interceptors to add custom keys as a callback before a report and also processing CMCD data on a callback after the server response.Batching
The CmcdBatchController is a new component designed to efficiently manage and send Common Media Client Data (CMCD) reports. Instead of sending each report as a separate HTTP request, this controller aggregates them into batches, reducing network traffic and server load.
batchTimer): You can configure abatchTimer(in seconds) for a reporting target. When the first report for a target is received, a timer is started. When the timer expires, all collected reports for that target are sent as a single batch.batchSize): You can configure abatchSizefor a reporting target. The controller tracks the number of reports in the current batch. Once the count reaches thebatchSize, the batch is sent immediately, even if thebatchTimerhas not expired.CmcdBatchControllerincludes logic to handle specific HTTP error responsesUnit Testing
Common Media Library Integration
Main Files Affected:
src/streaming/controllers/CmcdController.js: Contains the core logic for CMCD v2, including handling for new modes, multiple targets, key filtering, and integration with the CMCD library.src/streaming/models/CmcdModel.js: Updated to store and manage state for new CMCD v2 parameters and reporting modes.src/core/Settings.js(implied changes): Updated to include new configuration options for CMCD v2, particularly thestreaming.cmcd.targetsarray and CMCD version selection.These changes provide a much more flexible and powerful CMCD implementation, enabling richer analytics and better interoperability with CDNs and other services that consume CMCD data.
Future Work
While the current implementation of CMCD v2 in dash.js provides basic functionality, there are several areas identified for future enhancements and development: