user1908850
user1908850

Reputation: 27

volume slider has no effect

I am creating a radio streaming app with play, pause and volume slider.

I have implemented volume slider using MPVolumeView but unfortunately it is not working.

Can any one please let me know the correct code so that the volume slider will work in my app. I have used MPMoviePlayerController, AVPlayer, AVAudioPlayer.

Upvotes: 1

Views: 604

Answers (1)

Till
Till

Reputation: 27587

Sounds as if you missed an important part of Apple's documentation; Working with Movies and iPod Music

I am suspecting that you are using both, AVAudioPlayer and MPMoviePlayerController together and that you have setup some audio session attributes to get that working properly. Now when doing so, you may want to tell MPMoviePlayerController to use that session / or not.

Using the Media Player Framework Exclusively

If your application is using a movie player only, or a music player only—and you are not playing your own sounds—then you should not configure an audio session.

If you are using a movie player exclusively, you must tell it to use its own audio session, as follows:

myMoviePlayer.useApplicationAudioSession = NO

If you are using a movie player and a music player, then you probably want to configure how the two interact; for this, you must configure an audio session, even though you are not playing application audio per se. Use the guidance in Table 6-1.

enter image description here

Upvotes: 1

Related Questions