media session for windows/mac

This commit is contained in:
Kendall Garner 2023-05-24 18:35:17 -07:00 committed by Jeff
parent f83639d5f8
commit d055ae89e0

View file

@ -24,7 +24,7 @@ const mpvPlayerListener = isElectron() ? window.electron.mpvPlayerListener : nul
const ipc = isElectron() ? window.electron.ipc : null; const ipc = isElectron() ? window.electron.ipc : null;
const utils = isElectron() ? window.electron.utils : null; const utils = isElectron() ? window.electron.utils : null;
const mpris = isElectron() && utils?.isLinux() ? window.electron.mpris : null; const mpris = isElectron() && utils?.isLinux() ? window.electron.mpris : null;
const mediaSession = !isElectron() ? navigator.mediaSession : null; const mediaSession = !isElectron() || !utils?.isLinux() ? navigator.mediaSession : null;
export const useCenterControls = (args: { playersRef: any }) => { export const useCenterControls = (args: { playersRef: any }) => {
const { playersRef } = args; const { playersRef } = args;