MPMusicPlayerControllerNowPlayingItemDidChange works just once in Monterey

Last year I built a jukebox app in Mac Catalyst that gives me greater control over my playlists. Specifically it allows scheduling of playlists at certain hours, maintains artist separation, and excludes songs from frequent playback by filtering out recently played items. With the exception of playback time not working and resorting to a weird fix, as reported here, I was very pleased with the result until I upgraded from Big Sur to Monterey this month. I then discovered that the MPMusicPlayerControllerNowPlayingItemDidChange notification has lost functionality, as it only works once per playback queue, then fails to fire until a new playback queue is called up. I had to build a workaround that changes out song info upon playback time reverting to zero, which seems an unnecessary addition to overhead. No one has posted about this yet, so I thought I’d put in my two cents on the matter. Thanks for any attention you can direct toward this… “bug”?

I've found the MPMusicPlayerControllerNowPlayingItemDidChange notification unreliable in iOS more often than not. My code keeps track of the playing item, watches for end of play, reloads the queue with the next track and plays it. All manual, all the time. I'm using the same code in the Mac M1 app version, so I don't experience the same problem with this issue. Wish I had better news or a better overall experienced to report. Sorry.

MPMusicPlayerControllerNowPlayingItemDidChange works just once in Monterey
 
 
Q