Question

I'm using MPMusicPlayerController to play a list of mp3 in my app.

The only problem is when I set the volume level, according with app configuration, appears a Volume Level pop up.

I tried to find any property in order to hide it, but I didn't find.

The code I'm using is:

if (audioPlayer)
    if ([audioPlayer isPlaying])
        [audioPlayer stop];

self.musicPlayer = [MPMusicPlayerController applicationMusicPlayer];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePlaybackStateChanged:) name:MPMusicPlayerControllerPlaybackStateDidChangeNotification object:self.musicPlayer];

[self.musicPlayer beginGeneratingPlaybackNotifications];

[self.musicPlayer setAccessibilityElementsHidden:YES];
self.musicPlayer.volume = volume;

[self.musicPlayer setQueueWithItemCollection:mediaItemCollection];

self.musicPlayer.repeatMode = MPMusicRepeatModeAll;

[self.musicPlayer play];

My question is, Any way to avoid this pop up?

Thanks.

Was it helpful?

Solution

I found a workaround for this problem in other post

But, there is not a direct way to perform that without using MPVolumeView "invisible"?

Sorry :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top