mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-02 05:04:15 -04:00
Reset hls when leaving play page
This commit is contained in:
parent
7e95370ce0
commit
55f55db030
@ -173,6 +173,10 @@ const Video = forwardRef<{ seek: (value: number) => void }, VideoProps>(function
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return () => {
|
||||||
|
if (hls) hls.destroy();
|
||||||
|
hls = null;
|
||||||
|
};
|
||||||
}, [source.uri, source.hls]);
|
}, [source.uri, source.hls]);
|
||||||
|
|
||||||
const mode = useAtomValue(playModeAtom);
|
const mode = useAtomValue(playModeAtom);
|
||||||
@ -348,7 +352,7 @@ export const AudiosMenu = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!hls) return;
|
if (!hls) return;
|
||||||
hls.on(Hls.Events.AUDIO_TRACK_LOADED, rerender);
|
hls.on(Hls.Events.AUDIO_TRACK_LOADED, rerender);
|
||||||
return () => hls!.off(Hls.Events.AUDIO_TRACK_LOADED, rerender);
|
return () => hls?.off(Hls.Events.AUDIO_TRACK_LOADED, rerender);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!hls) return <Menu {...props} disabled {...tooltip(t("player.notInPristine"))} />;
|
if (!hls) return <Menu {...props} disabled {...tooltip(t("player.notInPristine"))} />;
|
||||||
@ -376,7 +380,7 @@ export const QualitiesMenu = (props: ComponentProps<typeof Menu>) => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!hls) return;
|
if (!hls) return;
|
||||||
hls.on(Hls.Events.LEVEL_SWITCHED, rerender);
|
hls.on(Hls.Events.LEVEL_SWITCHED, rerender);
|
||||||
return () => hls!.off(Hls.Events.LEVEL_SWITCHED, rerender);
|
return () => hls?.off(Hls.Events.LEVEL_SWITCHED, rerender);
|
||||||
});
|
});
|
||||||
|
|
||||||
const levelName = (label: Level, auto?: boolean): string => {
|
const levelName = (label: Level, auto?: boolean): string => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user