2015-07-08 13 views
6

Pracuję nad aplikacją do odtwarzania muzyki, w poprzednich wersjach iOS odtwarzacz multimedialny wyświetlał przyciski odtwarzania/pauzy, a także przyciski przeskakiwania i prev. Teraz, po aktualizacji 8.4, wszystko, co jest pokazane, to gra/pauza. Ja aktualizację MPNowPlayingInfoCenter w zwykły sposób:iOS 8.4 MPNowPlayingInfoCenter pominięcie/prev zniknęło

NSDictionary* nowPlayingInfo = @{ 
    MPMediaItemPropertyTitle:[self.currentSong title], 
    MPMediaItemPropertyArtist:[self.currentSong artist], 
    MPMediaItemPropertyPlaybackDuration:[NSNumber numberWithDouble:(double) self.duration], 
    MPNowPlayingInfoPropertyElapsedPlaybackTime: [NSNumber numberWithDouble:(double)self.currentPlaybackTime], 
    MPNowPlayingInfoPropertyPlaybackRate: self.isPlaying ? @1.0 : @0.0, 
    MPMediaItemPropertyArtwork: mediaPlayerArtwork, 
    MPNowPlayingInfoPropertyPlaybackQueueIndex: [NSNumber numberWithInteger:playQueue.queuePosition], 
    MPNowPlayingInfoPropertyPlaybackQueueCount: [NSNumber numberWithInteger:playQueue.queueIDs.count] }; 
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:nowPlayingInfo]; 

Ale wynik jest ... enter image description here

i enter image description here

dzięki za pomoc!

Odpowiedz

5

Aby dostać następną i prev przyciski kopię trzeba dodać:

[[MPRemoteCommandCenter sharedCommandCenter].nextTrackCommand addTarget:self action:@selector(remoteNextPrevTrackCommandReceived:)]; 
[[MPRemoteCommandCenter sharedCommandCenter].previousTrackCommand addTarget:self action:@selector(remoteNextPrevTrackCommandReceived:)]; 

dodałem to w AppDelegate za

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

Jeśli jesteś już otrzymującego odległe wydarzenia akcji Metoda może być pusta:

-(void) remoteNextPrevTrackCommandReceived:(id)event {}