AVPlayer mute and AVAudioSession options ignored when audio routed to airplay

Originator:jgary
Number:rdar://38751103 Date Originated:3/22/2018
Status:Open Resolved:
Product:iOS/AVFoundation Product Version:11.2.6
Classification:Serious Bug Reproducible:Always
 
Summary:
When audio is routed over AirPlay, audio-related API's related to using AVPlayer in an iOS app do not work at all. The attached project demonstrates the issue.

Steps to Reproduce:
- Open Music.app on iPhone
- Turn on your AppleTV
- Play a song
- Tap on the control bar at the bottom of the Music app to enlarge the controls. 
- Tap on the AirPlay control at the bottom center of the song card.
- Select Apple TV from the list of devices
- Confirm music is playing through AppleTV. AppleTV shows Song title and graphic.
- Open the Play One Video app (see attached project).
- Tap the play button

Expected Results:
- Video plays silently over music
- tapping mute button unmutes the video, mixing with the music


Actual Results:
- Music stops
- Audio from player plays through AppleTV without respecting mute/unmute
- Notice that the app sets the AVAudioSessionMode to AVAudioSessionCategoryPlayback, .mixWithOthers, though the behavior is the same and incorrect without it when playing over AirPlay.

Version/Build:
11.2.6 (15D100)

Configuration:
iPhone 6S Plus
Summary:
When audio is routed over AirPlay, audio-related API's related to using AVPlayer in an iOS app do not work at all. The attached project demonstrates the issue, and the same issue affects the Twitter for iOS app.

Steps to Reproduce:
- Open Music.app on iPhone
- Turn on your AppleTV
- Play a song
- Tap on the control bar at the bottom of the Music app to enlarge the controls. 
- Tap on the AirPlay control at the bottom center of the song card.
- Select Apple TV from the list of devices
- Confirm music is playing through AppleTV. AppleTV shows Song title and graphic.
- Open the Play One Video app (see attached project).
- Tap the play button

Expected Results:
- Video plays silently over music
- tapping mute button unmutes the video, mixing with the music


Actual Results:
- Music stops
- Audio from player plays through AppleTV without respecting mute/unmute
- Notice that the app sets the AVAudioSessionMode to AVAudioSessionCategoryPlayback, .mixWithOthers, though the behavior is the same and incorrect without it when playing over AirPlay.

Version/Build:
11.2.6 (15D100)

Configuration:
iPhone 6S Plus

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!