iphone - iOS 8.4 MPNowPlayingInfoCenter skip/prev disappeared -
i'm working on music playing app , in previous ios versions media player show play/pause skip , prev buttons. now, 8.4 update, shown play/pause. i'm updating mpnowplayinginfocenter in usual way:
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];
but result is...
and
thanks help!
in order next , prev buttons need add:
[[mpremotecommandcenter sharedcommandcenter].nexttrackcommand addtarget:self action:@selector(remotenextprevtrackcommandreceived:)]; [[mpremotecommandcenter sharedcommandcenter].previoustrackcommand addtarget:self action:@selector(remotenextprevtrackcommandreceived:)];
i added in appdelegate's
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {
if you're receiving remote events action method can empty:
-(void) remotenextprevtrackcommandreceived:(id)event {}
Comments
Post a Comment