diff --git a/dash.d.ts b/dash.d.ts index 5364117a08..10b9f69ae6 100644 --- a/dash.d.ts +++ b/dash.d.ts @@ -1157,6 +1157,9 @@ declare namespace dashjs { mode?: 'query' | 'header', enabledKeys?: Array }, + dvbReporting?: { + reportingUrl?: string | null, + } cmsd?: { enabled?: boolean, abr?: { diff --git a/index.d.ts b/index.d.ts index 5364117a08..10b9f69ae6 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1157,6 +1157,9 @@ declare namespace dashjs { mode?: 'query' | 'header', enabledKeys?: Array }, + dvbReporting?: { + reportingUrl?: string | null, + } cmsd?: { enabled?: boolean, abr?: { diff --git a/src/core/Settings.js b/src/core/Settings.js index 510107c692..92d7f86331 100644 --- a/src/core/Settings.js +++ b/src/core/Settings.js @@ -247,6 +247,9 @@ import Events from './events/Events'; * mode: Constants.CMCD_MODE_QUERY, * enabledKeys: ['br', 'd', 'ot', 'tb' , 'bl', 'dl', 'mtp', 'nor', 'nrr', 'su' , 'bs', 'rtp' , 'cid', 'pr', 'sf', 'sid', 'st', 'v'] * }, + * dvbReporting: { + * reportingUrl: null, + * }, * cmsd: { * enabled: false, * abr: { @@ -783,6 +786,12 @@ import Events from './events/Events'; * This value is used to specify the desired CMCD parameters. Parameters not included in this list are not reported. */ +/** + * @typedef {Object} module:Settings~DvbReportingSettings + * @property {string} [reportingUrl] + * Overide DVB reporting url. + */ + /** * @typedef {Object} module:Settings~CmsdSettings * @property {boolean} [enabled=false] @@ -914,6 +923,8 @@ import Events from './events/Events'; * Adaptive Bitrate algorithm related settings. * @property {module:Settings~CmcdSettings} cmcd * Settings related to Common Media Client Data reporting. + * @property {module:Settings~DvbReportingSettings} dvbReporting + * Settings related to Common Media Client Data reporting. * @property {module:Settings~CmsdSettings} cmsd * Settings related to Common Media Server Data parsing. */ @@ -1179,6 +1190,9 @@ function Settings() { mode: Constants.CMCD_MODE_QUERY, enabledKeys: ['br', 'd', 'ot', 'tb', 'bl', 'dl', 'mtp', 'nor', 'nrr', 'su', 'bs', 'rtp', 'cid', 'pr', 'sf', 'sid', 'st', 'v'] }, + dvbReporting: { + reportingUrl: null, + }, cmsd: { enabled: false, abr: { diff --git a/src/streaming/metrics/controllers/MetricsController.js b/src/streaming/metrics/controllers/MetricsController.js index 87571da422..0bc84e255d 100644 --- a/src/streaming/metrics/controllers/MetricsController.js +++ b/src/streaming/metrics/controllers/MetricsController.js @@ -53,8 +53,7 @@ function MetricsController(config) { reportingController = ReportingController(context).create({ debug: config.debug, - metricsConstants: config.metricsConstants, - mediaPlayerModel: config.mediaPlayerModel + metricsConstants: config.metricsConstants }); reportingController.initialize(metricsEntry.Reporting, rangeController); diff --git a/src/streaming/metrics/reporting/reporters/DVBReporting.js b/src/streaming/metrics/reporting/reporters/DVBReporting.js index dfa11dc01c..33884448e0 100644 --- a/src/streaming/metrics/reporting/reporters/DVBReporting.js +++ b/src/streaming/metrics/reporting/reporters/DVBReporting.js @@ -32,7 +32,7 @@ import MetricSerialiser from '../../utils/MetricSerialiser'; import RNG from '../../utils/RNG'; import CustomParametersModel from '../../../models/CustomParametersModel'; - +import Settings from '../../../../core/Settings'; function DVBReporting(config) { config = config || {}; let instance; @@ -44,7 +44,8 @@ function DVBReporting(config) { reportingPlayerStatusDecided, isReportingPlayer, reportingUrl, - rangeController; + rangeController, + settings = Settings(context).getInstance(); let USE_DRAFT_DVB_SPEC = true; let allowPendingRequestsToCompleteOnReset = true; @@ -141,13 +142,13 @@ function DVBReporting(config) { rangeController = rc; - reportingUrl = entry.dvb_reportingUrl; + reportingUrl = settings.get().streaming.dvbReporting.reportingUrl || entry.dvb_reportingUrl; // If a required attribute is missing, the Reporting descriptor may // be ignored by the Player if (!reportingUrl) { throw new Error( - 'required parameter missing (dvb:reportingUrl)' + 'MPD parameter missing "dvb:reportingUrl" or URL not given in settings' ); }