Skip to content

Commit

Permalink
Fix invisible subtitles interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrews54757 committed Oct 6, 2024
1 parent 788dcb2 commit 3177741
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions chrome/player/ui/subtitles/SubtitlesManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ export class SubtitlesManager extends EventEmitter {

// Update elements
const currentTime = this.client.state.currentTime;
let subtitlesVisible = 0;

for (let i = 0; i < tracks.length; i++) {
const trackContainer = cachedElements[i];
Expand Down Expand Up @@ -667,6 +668,7 @@ export class SubtitlesManager extends EventEmitter {
trackContainer.style.opacity = '';

WebUtils.replaceChildrenPerformant(trackContainer, toAdd);
subtitlesVisible++;
}
}

Expand All @@ -683,6 +685,13 @@ export class SubtitlesManager extends EventEmitter {
}

WebUtils.replaceChildrenPerformant(trackContainer, [this.testCue]);
subtitlesVisible++;
}

if (subtitlesVisible) {
DOMElements.subtitlesContainer.style.display = '';
} else {
DOMElements.subtitlesContainer.style.display = 'none';
}

this.checkTrackBounds();
Expand Down

0 comments on commit 3177741

Please sign in to comment.