Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix captions disappear on unbuffered seeks when user activates, deactivates, and reactivates captions #2674

Merged
Merged
5 changes: 4 additions & 1 deletion lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -3507,8 +3507,11 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
// can override this and configure us to always stream captions.
if (!this.config_.streaming.alwaysStreamText) {
if (newVisibility) {
if (this.streamingEngine_.getCurrentTextStream()) {
const currentTextStream = this.streamingEngine_
.getCurrentTextStream();
if (currentTextStream) {
// We already have a selected text stream.
this.streamingEngine_.switchTextStream(currentTextStream);
} else {
// Find the text stream that best matches the user's preferences.
const streams =
Expand Down