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 mpris: any;
|
||||||
private mprisEvents: Object = {
|
private mprisEvents: Object = {
|
||||||
"playpause": "pausePlay",
|
"playpause": "playPause",
|
||||||
"play": "pausePlay",
|
"play": "play",
|
||||||
"pause": "pausePlay",
|
"pause": "pause",
|
||||||
"next": "nextTrack",
|
"next": "next",
|
||||||
"previous": "previousTrack",
|
"previous": "previous",
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
|
|
|
@ -88,20 +88,28 @@ const MusicKitInterop = {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
pausePlay: function () {
|
play: () => {
|
||||||
|
MusicKit.getInstance().play().then(r => console.log(`[MusicKitInterop.play] ${r}`));
|
||||||
|
},
|
||||||
|
|
||||||
|
pause: () => {
|
||||||
|
MusicKit.getInstance().pause();
|
||||||
|
},
|
||||||
|
|
||||||
|
playPause: () => {
|
||||||
if (MusicKit.getInstance().isPlaying) {
|
if (MusicKit.getInstance().isPlaying) {
|
||||||
MusicKit.getInstance().pause();
|
MusicKit.getInstance().pause();
|
||||||
} else if (MusicKit.getInstance().nowPlayingItem != null) {
|
} 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 () {
|
next: () => {
|
||||||
MusicKit.getInstance().skipToNextItem().then(r => console.log(`[MusicKitInterop] Skipping to Next ${r}`));
|
MusicKit.getInstance().skipToNextItem().then(r => console.log(`[MusicKitInterop.next] Skipping to Next ${r}`));
|
||||||
},
|
},
|
||||||
|
|
||||||
previousTrack: function () {
|
previous: () => {
|
||||||
MusicKit.getInstance().skipToPreviousItem().then(r => console.log(`[MusicKitInterop] Skipping to Previous ${r}`));
|
MusicKit.getInstance().skipToPreviousItem().then(r => console.log(`[MusicKitInterop.previous] Skipping to Previous ${r}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue