I have this MPMovePlayerController and a custom slider (which is not quite a slider, but it has the same purpose). Considering that my "slider" can return any float value I need, how can I change the volume of the played movie?
So far I'v tried hacking MPVolumeView to programmatically set a value, w/o success.
Turns out that
[[MPMusicPlayerController applicationMusicPlayer] setVolume:<insert float here>];
works for any sound in the app, even the MPMoviePlayerController, if it's using the main Audio Session. O, it works only on the device, not the simulator. More info here: https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller?language=objc
Volume is deprecated in iOS 7.0.
"To provide UI for adjusting system playback volume, use the
MPVolumeView
class, which provides media playback controls that iOS users expect and whose appearance you can customize." Deprecated MPMusicPlayerController Volume Method
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With