ios - AVAudioPlayer with remote control events -


i have problem work avaudioplayer. used avaudioplayer play audio resource file. use

[[uiapplication sharedapplication] beginreceivingremotecontrolevents]; [self becomefirstresponder]; 

to handle remote control event

when in background mode (lock screen) enter image description here

press pause button on lock screen, remote control events hidden, don't change play button. though don't set code endreceivingremotecontrolevents

enter image description here
code handle remote control events

 - (void)remotecontrolreceivedwithevent:(uievent *)event {         //if remote control event handle correctly         if (event.type == uieventtyperemotecontrol) {             if (event.subtype == uieventsubtyperemotecontrolplay) {                 [audioplayer play];             } else if (event.subtype == uieventsubtyperemotecontrolpause) {                 [audioplayer pause];             } else if (event.subtype == uieventsubtyperemotecontroltoggleplaypause) {                 [self toggleplaypause];             }         }     } 


happen remote control events after press pause button, please me. thank much!


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -