mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-10 22:32:17 +02:00
prevent desktopCaturer from running unless visualizer explicitly requested (#1931)
This commit is contained in:
@@ -21,6 +21,21 @@ type PromptState = 'loading' | { consent: boolean };
|
||||
|
||||
export function VisualizerSystemAudioBridgeHook() {
|
||||
const playbackType = usePlaybackType();
|
||||
const isVisualizerSurfaceVisible = useIsLocalVisualizerSurfaceVisible();
|
||||
|
||||
useEffect(() => {
|
||||
if (!isElectron()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const shouldReportVisible = playbackType === PlayerType.LOCAL && isVisualizerSurfaceVisible;
|
||||
|
||||
window.api.visualizer.setLocalSurfaceVisible(shouldReportVisible);
|
||||
|
||||
return () => {
|
||||
window.api.visualizer.setLocalSurfaceVisible(false);
|
||||
};
|
||||
}, [playbackType, isVisualizerSurfaceVisible]);
|
||||
|
||||
if (!isElectron() || playbackType !== PlayerType.LOCAL) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user