Add protocol for playpause and nextitem (#1329)

This commit is contained in:
Monochromish 2022-07-30 06:17:14 +10:00 committed by GitHub
parent 5920e82a30
commit 6370ef3003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,6 +168,14 @@ export class AppEvents {
utils.getWindow().webContents.executeJavaScript(`ipcRenderer.send('lastfm:auth', "${authURI.split('lastfm?token=')[1]}")`).catch(console.error)
}
}
else if (arg.includes('playpause')) {
//language=JS
utils.getWindow().webContents.executeJavaScript('MusicKitInterop.playPause()')
}
else if (arg.includes('nextitem')) {
//language=JS
utils.getWindow().webContents.executeJavaScript('app.mk.skipToNextItem()')
}
// Play
else if (arg.includes('/play/')) { //Steer away from protocol:// specific conditionals
const playParam = arg.split('/play/')[1]