AirPlay with AVPlayer/MPNowPlayingInfoCenter doesn't show album art on device

I'm developing a media player for Mac (AppKit, not Catalyst) that plays local and remote content. I have AirPlay working with AVPlayer (with an AVRoutePickerView assigning the route), but while I get the metadata that I've set for the MPNowPlayingInfoCenter on the AirPlay device (a TV in this case), I don't get any album art (but I do in the macOS now playing menu bar/control centre applet). It looks like this: (imgur link because I can't get it to upload in the forum): https://i.imgur.com/2JBIYCw.jpg

My code for setting the metadata:

        NSImage *artwork = [currentTrack coverImage];
        CGSize artworkSize = [artwork size];
        MPMediaItemArtwork *mpArtwork = [[MPMediaItemArtwork alloc] initWithBoundsSize:artworkSize requestHandler:^NSImage * _Nonnull(CGSize size) {
            return artwork;
        }];
        [songInfo setObject: mpArtwork forKey:MPMediaItemPropertyArtwork];

I noticed that it doesn't resize, but it seems at least macOS doesn't care. I tried modifying the code to resize the artwork in the callback, but that also doesn't change anything.

I noticed in the logs that I get a message about a missing entitlement:

2023-01-29 14:00:37.889346-0400 Submariner[42682:9794531] [Entitlements] MSVEntitlementUtilities - Process Submariner PID[42682] - Group: (null) - Entitlement: com.apple.mediaremote.external-artwork-validation - Entitled: NO - Error: (null)

...however, this seems to be a private entitlement and the only reference I can find to it is WebKit. Using it makes LaunchServices very angry at me, and I presume it's a red herring.

I got the same error suddenly in my radio-app. The artwork is shown normally. Never saw this error before. Suddenly the artwork on the AppleWatch-app isn't shown anymore maybe because of this entitlement? Anyone any idea?

Any update on this? I'm using AVPlayerViewController and if i set

avplayerController.player?.allowsExternalPlayback = false

When I airplay I see track, album title, artist name and artwork. If I don't set that, I only see track title. I need to keep that setting enabled, but I need the experience of it disabled

I got the exact same warning. Not sure how to fix it yet.

AirPlay with AVPlayer/MPNowPlayingInfoCenter doesn't show album art on device
 
 
Q