Updated Cider preload functions and MPRIS to reflect this
This commit is contained in:
parent
b972a0e40a
commit
9385008dc2
2 changed files with 19 additions and 11 deletions
|
@ -21,11 +21,11 @@ export default class MPRIS {
|
|||
*/
|
||||
private mpris: any;
|
||||
private mprisEvents: Object = {
|
||||
"playpause": "pausePlay",
|
||||
"play": "pausePlay",
|
||||
"pause": "pausePlay",
|
||||
"next": "nextTrack",
|
||||
"previous": "previousTrack",
|
||||
"playpause": "playPause",
|
||||
"play": "play",
|
||||
"pause": "pause",
|
||||
"next": "next",
|
||||
"previous": "previous",
|
||||
}
|
||||
|
||||
/*******************************************************************************************
|
||||
|
|
|
@ -88,20 +88,28 @@ const MusicKitInterop = {
|
|||
return true;
|
||||
},
|
||||
|
||||
pausePlay: function () {
|
||||
play: () => {
|
||||
MusicKit.getInstance().play().then(r => console.log(`[MusicKitInterop.play] ${r}`));
|
||||
},
|
||||
|
||||
pause: () => {
|
||||
MusicKit.getInstance().pause();
|
||||
},
|
||||
|
||||
playPause: () => {
|
||||
if (MusicKit.getInstance().isPlaying) {
|
||||
MusicKit.getInstance().pause();
|
||||
} else if (MusicKit.getInstance().nowPlayingItem != null) {
|
||||
MusicKit.getInstance().play().then(r => console.log(`[MusicKitInterop] Playing ${r}`));
|
||||
MusicKit.getInstance().play().then(r => console.log(`[MusicKitInterop.playPause] Playing ${r}`));
|
||||
}
|
||||
},
|
||||
|
||||
nextTrack: function () {
|
||||
MusicKit.getInstance().skipToNextItem().then(r => console.log(`[MusicKitInterop] Skipping to Next ${r}`));
|
||||
next: () => {
|
||||
MusicKit.getInstance().skipToNextItem().then(r => console.log(`[MusicKitInterop.next] Skipping to Next ${r}`));
|
||||
},
|
||||
|
||||
previousTrack: function () {
|
||||
MusicKit.getInstance().skipToPreviousItem().then(r => console.log(`[MusicKitInterop] Skipping to Previous ${r}`));
|
||||
previous: () => {
|
||||
MusicKit.getInstance().skipToPreviousItem().then(r => console.log(`[MusicKitInterop.previous] Skipping to Previous ${r}`));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue