I run -play with AVAudioPlayer and then install the nowPlaying dictionary as follows:
NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init]; MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage: [UIImage imagedNamed:@"AlbumArt"]]; [songInfo setObject:@"Audio Title" forKey:MPMediaItemPropertyTitle]; [songInfo setObject:@"Audio Author" forKey:MPMediaItemPropertyArtist]; [songInfo setObject:@"Audio Album" forKey:MPMediaItemPropertyAlbumTitle]; [songInfo setObject:albumArt forKey:MPMediaItemPropertyArtwork]; [[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo];
The pause button is always displayed on the lock screen. I correctly receive remote control events, and I can switch the play / pause through the events of the remote control, but the lock screen continues to show “pause” even during playback.
Now I have seen this work with MPMoviePlayerController. Can someone explain how MPNowPlayingInfoCenter determines if a play or pause button should be displayed?
ios iphone audio media-player mpnowplayinginfocenter
openfrog
source share