I done all these coding still unable play the video.....
Info.plistfile adding in theUIBackgroundModesarray the audio element.And added these two methods in
AppDelegate.m[[AVAudioSession sharedInstance] setDelegate: self]; [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];and this methods in the player class
(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; } - (void)viewWillDisappear:(BOOL)animated { [mPlayer pause]; [super viewWillDisappear:animated]; [[UIApplication sharedApplication] endReceivingRemoteControlEvents]; [self resignFirstResponder]; } (void)remoteControlReceivedWithEvent:(UIEvent *)event { switch (event.subtype) { case UIEventSubtypeRemoteControlTogglePlayPause: if([mPlayer rate] == 0){ [mPlayer play]; } else { [mPlayer pause]; } break; case UIEventSubtypeRemoteControlPlay: [mPlayer play]; break; case UIEventSubtypeRemoteControlPause: [mPlayer pause]; break; default: break; } }