I have a project with a MPVolumeView in it. It is set up, and it works, the only thing is that when I mute the device, the text "No Volume Available" comes up instead of the MPVolumeView. I would rather like the slider of the MPVolumeView to be disabled when the device is muted.
The volumeView is initialized in the view volumeBounds, with that view’s bounds.
MPVolumeView *volumeView = [[[MPVolumeView alloc] initWithFrame:volumeBounds.bounds] autorelease];
[volumeBounds addSubview:volumeView];
[volumeView sizeToFit];
Thanks 🙂
If you are interested in helping me with something else, check out this question
Use AudioServices to listen for the hardware volume. When the volume goes to zero, set the alpha of the MPVolumeSlider to zero and place your own disabled UISlider in the same position. Skin your slider to look like the volume slider.
kAudioSessionProperty_AudioRouteChangedmight also be useful.If you walk the view hierarchy under the MPVolumeView, you should find a UISlider. If not, or if it is hidden, you know the mute string is showing.
Edit:
This describes the function prototype for your listener. To pass the message to an instance of your class, do something similar to: