MPRemoteCommands not emitting events on tvOS 14

I haven't seen any info about this being a known issue in the release notes, but I have existing code for receiving play and pause events via MPRemoteCommandCenter that works fine on previous versions of tvOS; whereas on the tvOS 14 beta none of the commands are firing events in response to the Apple TV remote.

I am seeing this error in the console when pressing pause on the remote:

[NowPlaying] [MRPlaybackQueueServiceClient] Responded to playbackQueueRequest [...] with error Operation requires a client callback to have been registered.

Replies

I'm wondering if this has something to do with the introduction of MPNowPlayingSession on tvOS 14, given that a MPNowPlayingSession also introduces a remoteCommandCenter tied to the session.

I am not yet using MPNowPlayingSession (still using MPNowPlayingInfoCenter).
When I posted my original question, I thought I was stumped on finding a solution. Of course, only after posting my question did I have a hunch that this was due to the introduction of MPNowPlayingSession.

It turns out that's the issue. On tvOS 14 -- at least in the current beta -- it seems that using the MPRemoteCommandCenter sharedCommandCenter doesn't work. Instead, you must:
  • initialize a MPNowPlayingSession, passing in your AVPlayer instance

  • make the session active via becomeActiveIfPossibleWithCompletion

  • use the remoteCommandCenter property of the session, instead of MPRemoteCommandCenter sharedCommandCenter

And of course, once you have created a MPNowPlayingSession, you need to use that session nowPlayingInfoCenter property to publish now playing info instead of MPNowPlayingInfoCenter defaultCenter.

I will file a bug report about this, as I believe MPRemoteCommandCenter sharedCommandCenter should continue to work on tvOS 14, and the docs do not indicate that it is deprecated.

Hi Gavin, thanks for the great explanation. I've run into a similar issue and agree that the old even listeners seem to be depreciated. Any chance you can share the code chunk you used to initialize the MPNowPlayingSession?