mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-30 02:06:28 +00:00
Fix outdated qualites menu when hls instance changes
This commit is contained in:
@@ -393,6 +393,8 @@ export const QualitiesMenu = (props: ComponentProps<typeof Menu>) => {
|
||||
// biome-ignore lint/correctness/useExhaustiveDependencies: Inculde hls in dependency array
|
||||
useEffect(() => {
|
||||
if (!hls) return;
|
||||
// Also rerender when hls instance changes
|
||||
rerender();
|
||||
hls.on(Hls.Events.LEVEL_SWITCHED, rerender);
|
||||
return () => hls?.off(Hls.Events.LEVEL_SWITCHED, rerender);
|
||||
}, [hls]);
|
||||
|
||||
Reference in New Issue
Block a user