mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 04:20:07 +02:00
prevent mpv hotkey conflict with radio when inactive
This commit is contained in:
@@ -122,6 +122,7 @@ export const useRadioAudioInstance = () => {
|
||||
const { setCurrentStreamUrl, setIsPlaying, setStationName } = actions;
|
||||
const currentStreamUrl = useRadioStore((state) => state.currentStreamUrl);
|
||||
const isPlaying = useRadioStore((state) => state.isPlaying);
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const playbackType = usePlaybackType();
|
||||
const isUsingMpv = playbackType === PlayerType.LOCAL && mpvPlayer;
|
||||
|
||||
@@ -146,7 +147,7 @@ export const useRadioAudioInstance = () => {
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isUsingMpv || !mpvPlayerListener || !ipc) {
|
||||
if (!isUsingMpv || !mpvPlayerListener || !ipc || !isRadioActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -173,7 +174,7 @@ export const useRadioAudioInstance = () => {
|
||||
ipc.removeAllListeners('renderer-player-pause');
|
||||
ipc.removeAllListeners('renderer-player-stop');
|
||||
};
|
||||
}, [isUsingMpv, setIsPlaying, setCurrentStreamUrl, setStationName]);
|
||||
}, [isUsingMpv, isRadioActive, setIsPlaying, setCurrentStreamUrl, setStationName]);
|
||||
|
||||
usePlayerEvents(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user