I am working on a voip app and want to route audio to bluetooth. I learned that the only way to do is to bring up airplay menu using MPVolumeView. The downside of the MPVolumeView is that it is not very customizeable. I looked at facebook and spotify outlook app and find that they both have customized it more than what is provided by the MPVolumeView API. I am wondering if they are really using the MPVOlumeView or that have a custom view and programatically send tap event to the button inside MPVolumeView?
Asked
Active
Viewed 164 times
1 Answers
0
This may be helpful: you can change the image of the button as the Spotify app does by inspecting the current audio session route, and using the routeButtonImage customizer API on MPVolumeView.
let audioSession = AVAudioSession.sharedInstance( )
if let output = audioSession.currentRoute.outputs.first
{
let myCustomImage = <#Use information from the output (AVAudioSessionPortDescription) to set a custom image #>
myVolumeView.setRouteButtonImage( myCustomImage, for: .normal )
}

Chris Hinkle
- 4,304
- 1
- 16
- 11