I'm developing an iOS app that plays audio. I use an AVAudioSession in .playback, and have MPNowPlayingInfoCenter and MPRemoteCommandCenter integrated, along with audio and AirPlay background modes. It works nearly flawlessly and seamlessly across Apple devices, e.g. now playing controls pop up on Apple Watch, I can AirPlay to AppleTV and Homepod.
The one issue I am having is that when I AirPlay to AppleTV, while the audio plays and I can control the volume from my phone or watch, I do not get the now playing controls. However, if I AirPlay Spotify from my iPhone to AppleTV (Spotify app not installed on AppleTV), in the top right of the tv screen, the album art and song info briefly pop up near the time and profile initials (then disappear after a few seconds) and the "audio output animation/waveform" then appear between the time and profile initials. If I open the command center and highlight the audio waveform icon, the song info pops up with mini audio controls, and if I select the audio waveform icon, it switches to full screen and displays album and song info. It also switches to full screen if I let if play for a few minutes.
I don't get that behavior with my app (although the audio plays fine and I can control track selection and volume from my phone/watch). However, if Spotify is playing and I then AirPlay from my app, my app then displays full screen with album art and song info...that's the only way I can get my app to display anything.
Any idea what could be causing the difference in behavior? Running iOS 18.3.1 on iPhone and tvOS 18.3.
I'm developing an iOS app that plays audio. I use an AVAudioSession in .playback, and have MPNowPlayingInfoCenter and MPRemoteCommandCenter integrated, along with audio and AirPlay background modes. It works nearly flawlessly and seamlessly across Apple devices, e.g. now playing controls pop up on Apple Watch, I can AirPlay to AppleTV and Homepod.
The one issue I am having is that when I AirPlay to AppleTV, while the audio plays and I can control the volume from my phone or watch, I do not get the now playing controls. However, if I AirPlay Spotify from my iPhone to AppleTV (Spotify app not installed on AppleTV), in the top right of the tv screen, the album art and song info briefly pop up near the time and profile initials (then disappear after a few seconds) and the "audio output animation/waveform" then appear between the time and profile initials. If I open the command center and highlight the audio waveform icon, the song info pops up with mini audio controls, and if I select the audio waveform icon, it switches to full screen and displays album and song info. It also switches to full screen if I let if play for a few minutes.
I don't get that behavior with my app (although the audio plays fine and I can control track selection and volume from my phone/watch). However, if Spotify is playing and I then AirPlay from my app, my app then displays full screen with album art and song info...that's the only way I can get my app to display anything.
Any idea what could be causing the difference in behavior? Running iOS 18.3.1 on iPhone and tvOS 18.3.
Share Improve this question edited Feb 16 at 0:48 HangarRash 15.1k5 gold badges19 silver badges55 bronze badges asked Feb 16 at 0:45 bruno617bruno617 606 bronze badges1 Answer
Reset to default 0Confirmed that nowPlayingInfo needs to contain:
nowPlayingInfo[MPNowPlayingInfoPropertyMediaType] = MPNowPlayingInfoMediaType.audio.rawValue