Skip to content

Commit

Permalink
fix: honor autoShowText on non-audio streams (#6977)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Jul 3, 2024
1 parent c6e2c43 commit ef15d13
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -6940,7 +6940,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
// Check if we should show text (based on difference between audio and text
// languages).
if (initialTextStream) {
if (initialVariant.audio && this.shouldInitiallyShowText_(
if (this.shouldInitiallyShowText_(
initialVariant.audio, initialTextStream)) {
this.isTextVisible_ = true;
}
Expand All @@ -6960,7 +6960,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
/**
* Check if we should show text on screen automatically.
*
* @param {shaka.extern.Stream} audioStream
* @param {?shaka.extern.Stream} audioStream
* @param {shaka.extern.Stream} textStream
* @return {boolean}
* @private
Expand Down Expand Up @@ -6991,6 +6991,9 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
}

if (this.config_.autoShowText == AutoShowText.IF_SUBTITLES_MAY_BE_NEEDED) {
if (!audioStream) {
return false;
}
/* The text should automatically be shown if the text is
* language-compatible with the user's text language preference, but not
* compatible with the audio. These are cases where we deduce that
Expand Down

0 comments on commit ef15d13

Please sign in to comment.