partially fix web-remote

This commit is contained in:
vapormusic 2022-01-20 22:53:01 +07:00
parent 443711df79
commit ac93ef1aee
5 changed files with 97 additions and 84 deletions

View file

@ -10,12 +10,19 @@ const MusicKitInterop = {
if (MusicKitInterop.filterTrack(MusicKitInterop.getAttributes(), true, false)) {
console.log("ayy");
global.ipcRenderer.send('playbackStateDidChange', MusicKitInterop.getAttributes())
ipcRenderer.send('wsapi-updatePlaybackState', self.getAttributes());
// if (typeof _plugins != "undefined") {
// _plugins.execute("OnPlaybackStateChanged", {Attributes: MusicKitInterop.getAttributes()})
// }
}
});
/** wsapi */
MusicKit.getInstance().addEventListener(MusicKit.Events.playbackProgressDidChange, () => {
ipcRenderer.send('wsapi-updatePlaybackState', self.getAttributes());
});
/** wsapi */
MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, () => {
if (MusicKitInterop.filterTrack(MusicKitInterop.getAttributes(), false, true)) {
global.ipcRenderer.send('nowPlayingItemDidChange', MusicKitInterop.getAttributes());