Open antonkoetzler opened 1 year ago
Sample code (provide repo url or sample code)
// Code used to init MusicControl export async function initNotification(path) { MusicControl.stopControl(); MusicControl.enableBackgroundMode(true); MusicControl.enableControl("play", true); MusicControl.enableControl("pause", true); MusicControl.enableControl("stop", true); MusicControl.enableControl("nextTrack", true); MusicControl.enableControl("previousTrack", true); MusicControl.enableControl("changePlaybackPosition", false); MusicControl.enableControl("seekForward", false); MusicControl.enableControl("seekBackward", false); MusicControl.enableControl("seek", false); MusicControl.enableControl("skipForward", false); MusicControl.enableControl("skipBackward", false); MusicControl.enableControl("setRating", false); MusicControl.enableControl("volume", false); MusicControl.enableControl("remoteVolume", false); MusicControl.enableControl("enableLanguageOption", false); MusicControl.enableControl("disableLanguageOption", false); let name = null; for (var i = (path.length - 1); i >= 0; i--) { if (path[i] == '/') { name = path.substr(i + 1); name = name.substr(0, name.length - 4); } } MusicControl.setNowPlaying({ title: name, artwork: require("./DefaultAlbumCover.png"), artist: "", album: "", genre: "", description: "", color: 0x7393b3, colorized: true, date: "", isLiveStream: false }); MusicControl.on(Command.previousTrack, previousSong); MusicControl.on(Command.play, () => { toggleNotificationPlay(); }); MusicControl.on(Command.pause, () => { toggleNotificationPlay(); }); MusicControl.on(Command.nextTrack, nextSong); }
Whenever I call MusicControl.updatePlayback, it never actually changes anything in the notification. As well, using the notification buttons when the app is in the background never changes the text of the notification.
Sample code (provide repo url or sample code)
Whenever I call MusicControl.updatePlayback, it never actually changes anything in the notification. As well, using the notification buttons when the app is in the background never changes the text of the notification.