mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-04-08 18:22:05 -04:00
Fix language preference being reset on episode switch
This commit is contained in:
parent
1a989589aa
commit
65bb461eac
@ -44,11 +44,11 @@ export const useLanguagePreference = (player: VideoPlayer, slug: string) => {
|
||||
forced: false,
|
||||
});
|
||||
useEvent(player, "onTrackChange", (s) => {
|
||||
if (!subtitles?.length) return;
|
||||
if (!s) {
|
||||
sub.current = { idx: null, lang: null, forced: false };
|
||||
return;
|
||||
}
|
||||
if (!subtitles?.length) return;
|
||||
const idx = player.getAvailableTextTracks().findIndex((x) => x.selected);
|
||||
sub.current = {
|
||||
idx: idx,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user