I am using MPMoviePlayer
in my view controller. In viewwillappear
I am doing
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[self becomeFirstResponder];
but -(void)remoteControlReceivedWithEvent:(UIEvent *)event
is not getting called anytime when I clicked for next track or previous track buttons on player.
I have also included following code in viewwillappear
NSError *setCategoryErr = nil;
NSError *activationErr = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &setCategoryErr];
[[AVAudioSession sharedInstance] setActive: YES error: &activationErr];
Let me know what can be the issue? Or give me an example or some sample code where we can notify UIEventSubtypeRemoteControlNextTrack
and UIEventSubtypeRemoteControlPreviousTrack
events.
in my appdelegate I have..
and then in my ViewController I have..
hope this helps.