Skip to content

Commit

Permalink
Use deprecate instead of alwaysWarn
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Apr 24, 2024
1 parent dbff858 commit 19177ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
if (textDisplayer.configure) {
textDisplayer.configure(this.config_.textDisplayer);
} else {
shaka.log.alwaysWarn('Text displayer should have a "configure" method!');
shaka.Deprecate.deprecateFeature(5,
'Text displayer w/ configure',
'Text displayer should have a "configure" method!');
}
this.lastTextFactory_ = textDisplayerFactory;

Expand Down Expand Up @@ -3444,7 +3446,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
if (displayer.configure) {
displayer.configure(this.config_.textDisplayer);
} else {
shaka.log.alwaysWarn(
shaka.Deprecate.deprecateFeature(5,
'Text displayer w/ configure',
'Text displayer should have a "configure" method!');
}
this.mediaSourceEngine_.setTextDisplayer(displayer);
Expand Down
8 changes: 5 additions & 3 deletions lib/text/text_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
goog.provide('shaka.text.TextEngine');

goog.require('goog.asserts');
goog.require('shaka.log');
goog.require('shaka.Deprecate');
goog.require('shaka.media.ClosedCaptionParser');
goog.require('shaka.text.Cue');
goog.require('shaka.util.BufferUtils');
Expand Down Expand Up @@ -153,13 +153,15 @@ shaka.text.TextEngine = class {
if (this.parser_.setSequenceMode) {
this.parser_.setSequenceMode(sequenceMode);
} else {
shaka.log.alwaysWarn(
shaka.Deprecate.deprecateFeature(5,
'Text parsers w/ setSequenceMode',
'Text parsers should have a "setSequenceMode" method!');
}
if (this.parser_.setManifestType) {
this.parser_.setManifestType(manifestType);
} else {
shaka.log.alwaysWarn(
shaka.Deprecate.deprecateFeature(5,
'Text parsers w/ setManifestType',
'Text parsers should have a "setManifestType" method!');
}
this.segmentRelativeVttTiming_ = segmentRelativeVttTiming;
Expand Down

0 comments on commit 19177ab

Please sign in to comment.