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(UI): Fix exception while casting to mismatched player version #7631

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ui/chapter_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,18 @@ shaka.ui.ChapterSelection = class extends shaka.ui.SettingsMenu {
const currentLocales = this.localization.getCurrentLocales();
for (const locale of Array.from(currentLocales)) {
nextLanguage = locale;
nextChapters = this.player.getChapters(nextLanguage);
// If player is a proxy, and the cast receiver doesn't support this
// method, you get back undefined.
nextChapters = this.player.getChapters(nextLanguage) || [];
if (nextChapters.length) {
break;
}
}
if (!nextChapters.length) {
nextLanguage = 'und';
nextChapters = this.player.getChapters(nextLanguage);
// If player is a proxy, and the cast receiver doesn't support this
// method, you get back undefined.
nextChapters = this.player.getChapters(nextLanguage) || [];
}

const languageChanged = nextLanguage !== this.chaptersLanguage_;
Expand Down
Loading