Skip to content

Commit

Permalink
fix: Fix UITextDisplayer desync & null pointer exception (#7199)
Browse files Browse the repository at this point in the history
Fixes bugs introduced in #6985
  • Loading branch information
tykus160 authored Aug 23, 2024
1 parent fd5b09c commit 247753d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2371,6 +2371,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
'Text displayer should have a "configure" method!');
}
this.lastTextFactory_ = textDisplayerFactory;
this.textDisplayer_.setTextVisibility(this.isTextVisible_);
}

/**
Expand Down Expand Up @@ -4083,7 +4084,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
}
this.textDisplayer_.setTextVisibility(oldDisplayer.isTextVisible());
oldDisplayer.destroy();
this.mediaSourceEngine_.setTextDisplayer(this.textDisplayer_);
if (this.mediaSourceEngine_) {
this.mediaSourceEngine_.setTextDisplayer(this.textDisplayer_);
}
this.lastTextFactory_ = textDisplayerFactory;

if (this.streamingEngine_) {
Expand Down

0 comments on commit 247753d

Please sign in to comment.