I wish to know if in somehow it's possible to increase programmatically the volume of the AirPlay speaker connected to my iOS Device. In specific, for increase or decrease programmatically the volume when NOT connected to Bluetooth I'm using the following code:
But the above code is not working for AirPlay audio's. It's only for device volume. Does anyone have any idea on how to increase the AirPlay audio programmatically ? Thanks 🙏
Code Block static func setVolume(_ volume: Float) { let volumeView = MPVolumeView() let slider = volumeView.subviews.first(where: { $0 is UISlider }) as? UISlider DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.001) { slider?.value = volume } }
But the above code is not working for AirPlay audio's. It's only for device volume. Does anyone have any idea on how to increase the AirPlay audio programmatically ? Thanks 🙏