enable mediaSession api (#1040)

* enable mediaSession api
This commit is contained in:
Mike Benz
2025-10-12 23:59:30 +02:00
committed by GitHub
parent 3636384508
commit f07393c82a
6 changed files with 63 additions and 2 deletions
+8 -1
View File
@@ -548,7 +548,14 @@ async function createWindow(first = true): Promise<void> {
}
}
app.commandLine.appendSwitch('disable-features', 'HardwareMediaKeyHandling,MediaSessionService');
const enableWindowsMediaSession = store.get('mediaSession', false) as boolean;
const shouldDisableMediaFeatures = process.platform !== 'win32' || !enableWindowsMediaSession;
if (shouldDisableMediaFeatures) {
app.commandLine.appendSwitch(
'disable-features',
'HardwareMediaKeyHandling,MediaSessionService',
);
}
// https://github.com/electron/electron/issues/46538#issuecomment-2808806722
app.commandLine.appendSwitch('gtk-version', '3');