Skip to content

Commit 0873d1e

Browse files
authored
fix: Fix deprecation warning for manifestPreprocessor that is always logged (#6496)
Fixes #6488
1 parent 1d51c82 commit 0873d1e

File tree

3 files changed

+42
-24
lines changed

3 files changed

+42
-24
lines changed

lib/dash/dash_parser.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ goog.require('shaka.util.MimeUtils');
3030
goog.require('shaka.util.Networking');
3131
goog.require('shaka.util.OperationManager');
3232
goog.require('shaka.util.PeriodCombiner');
33+
goog.require('shaka.util.PlayerConfiguration');
3334
goog.require('shaka.util.StringUtils');
3435
goog.require('shaka.util.Timer');
3536
goog.require('shaka.util.TXml');
@@ -338,7 +339,9 @@ shaka.dash.DashParser = class {
338339
async parseManifest_(data, finalManifestUri) {
339340
let manifestData = data;
340341
const manifestPreprocessor = this.config_.dash.manifestPreprocessor;
341-
if (manifestPreprocessor) {
342+
const defaultManifestPreprocessor =
343+
shaka.util.PlayerConfiguration.defaultManifestPreprocessor;
344+
if (manifestPreprocessor != defaultManifestPreprocessor) {
342345
shaka.Deprecate.deprecateFeature(5,
343346
'manifest.dash.manifestPreprocessor configuration',
344347
'Please Use manifest.dash.manifestPreprocessorTXml instead.');
@@ -364,7 +367,9 @@ shaka.dash.DashParser = class {
364367
}
365368
const manifestPreprocessorTXml =
366369
this.config_.dash.manifestPreprocessorTXml;
367-
if (manifestPreprocessorTXml) {
370+
const defaultManifestPreprocessorTXml =
371+
shaka.util.PlayerConfiguration.defaultManifestPreprocessorTXml;
372+
if (manifestPreprocessorTXml != defaultManifestPreprocessorTXml) {
368373
manifestPreprocessorTXml(mpd);
369374
}
370375

lib/mss/mss_parser.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ goog.require('shaka.util.ManifestParserUtils');
2323
goog.require('shaka.util.MimeUtils');
2424
goog.require('shaka.util.Mp4Generator');
2525
goog.require('shaka.util.OperationManager');
26+
goog.require('shaka.util.PlayerConfiguration');
2627
goog.require('shaka.util.Timer');
2728
goog.require('shaka.util.TXml');
2829
goog.require('shaka.util.XmlUtils');
@@ -282,7 +283,9 @@ shaka.mss.MssParser = class {
282283
parseManifest_(data, finalManifestUri) {
283284
let manifestData = data;
284285
const manifestPreprocessor = this.config_.mss.manifestPreprocessor;
285-
if (manifestPreprocessor) {
286+
const defaultManifestPreprocessor =
287+
shaka.util.PlayerConfiguration.defaultManifestPreprocessor;
288+
if (manifestPreprocessor != defaultManifestPreprocessor) {
286289
shaka.Deprecate.deprecateFeature(5,
287290
'manifest.mss.manifestPreprocessor configuration',
288291
'Please Use manifest.mss.manifestPreprocessorTXml instead.');
@@ -307,7 +310,9 @@ shaka.mss.MssParser = class {
307310
finalManifestUri);
308311
}
309312
const manifestPreprocessorTXml = this.config_.mss.manifestPreprocessorTXml;
310-
if (manifestPreprocessorTXml) {
313+
const defaultManifestPreprocessorTXml =
314+
shaka.util.PlayerConfiguration.defaultManifestPreprocessorTXml;
315+
if (manifestPreprocessorTXml != defaultManifestPreprocessorTXml) {
311316
manifestPreprocessorTXml(mss);
312317
}
313318
this.processManifest_(mss, finalManifestUri);

lib/util/player_configuration.js

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,10 @@ shaka.util.PlayerConfiguration = class {
141141
'urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95':
142142
'com.microsoft.playready',
143143
},
144-
manifestPreprocessor: (element) => {
145-
return shaka.util.ConfigUtils.referenceParametersAndReturn(
146-
[element],
147-
element);
148-
},
149-
manifestPreprocessorTXml: (element) => {
150-
return shaka.util.ConfigUtils.referenceParametersAndReturn(
151-
[element],
152-
element);
153-
},
144+
manifestPreprocessor:
145+
shaka.util.PlayerConfiguration.defaultManifestPreprocessor,
146+
manifestPreprocessorTXml:
147+
shaka.util.PlayerConfiguration.defaultManifestPreprocessorTXml,
154148
sequenceMode: false,
155149
enableAudioGroups: false,
156150
multiTypeVariantsAllowed,
@@ -174,16 +168,10 @@ shaka.util.PlayerConfiguration = class {
174168
allowLowLatencyByteRangeOptimization: true,
175169
},
176170
mss: {
177-
manifestPreprocessor: (element) => {
178-
return shaka.util.ConfigUtils.referenceParametersAndReturn(
179-
[element],
180-
element);
181-
},
182-
manifestPreprocessorTXml: (element) => {
183-
return shaka.util.ConfigUtils.referenceParametersAndReturn(
184-
[element],
185-
element);
186-
},
171+
manifestPreprocessor:
172+
shaka.util.PlayerConfiguration.defaultManifestPreprocessor,
173+
manifestPreprocessorTXml:
174+
shaka.util.PlayerConfiguration.defaultManifestPreprocessorTXml,
187175
sequenceMode: false,
188176
keySystemsBySystemId: {
189177
'9a04f079-9840-4286-ab92-e65be0885f95':
@@ -615,4 +603,24 @@ shaka.util.PlayerConfiguration = class {
615603

616604
return selectedTracks;
617605
}
606+
607+
/**
608+
* @param {!Element} element
609+
* @return {!Element}
610+
*/
611+
static defaultManifestPreprocessor(element) {
612+
return shaka.util.ConfigUtils.referenceParametersAndReturn(
613+
[element],
614+
element);
615+
}
616+
617+
/**
618+
* @param {!shaka.extern.xml.Node} element
619+
* @return {!shaka.extern.xml.Node}
620+
*/
621+
static defaultManifestPreprocessorTXml(element) {
622+
return shaka.util.ConfigUtils.referenceParametersAndReturn(
623+
[element],
624+
element);
625+
}
618626
};

0 commit comments

Comments
 (0)