fix mediasession controls

This commit is contained in:
jeffvli
2025-12-04 01:31:57 -08:00
parent 69fa5bc733
commit 4d626377ef
7 changed files with 98 additions and 58 deletions
+7 -2
View File
@@ -477,10 +477,15 @@ async function createWindow(first = true): Promise<void> {
}
}
const enableWindowsMediaSession = store.get('mediaSession', false) as boolean;
// Only allow hardware media key handling if:
// 1. The "Enable Media Session" setting is enabled
// 2. The playback type is WEB (mpv not supported)
// 3. The platform is not Linux (because we are using mpris instead)
const enableMediaSession = store.get('mediaSession', false) as boolean;
const playbackType = store.get('playbackType', PlayerType.WEB) as PlayerType;
const shouldDisableMediaFeatures =
!isWindows() || !enableWindowsMediaSession || playbackType !== PlayerType.WEB;
isLinux() || !enableMediaSession || playbackType !== PlayerType.WEB;
if (shouldDisableMediaFeatures) {
app.commandLine.appendSwitch(
'disable-features',