I am working with iOS5.
I am working on HTTPLivestream project .Here i am using MPMovieplayer ,my problem is when application goes to background there is no audio . i am changing the plist in background mode is audio.But there is no result please help me .
AppDel
- (void)applicationDidEnterBackground:(UIApplication *)application { [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; [[AVAudioSession sharedInstance] setActive: YES error: nil]; UIApplication *app = [UIApplication sharedApplication]; backgroundTask = [app beginBackgroundTaskWithExpirationHandler:^{ }]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ });}
RadioControlView
NSString *path =[[NSString alloc] initWithString:@"http://*******/alayam/alayam/playlist.m3u8"]; audioUrl=[NSURL URLWithString:path]; appDelegate.player = [[MPMoviePlayerController alloc] initWithContentURL:audioUrl]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification object:appDelegate.player]; if ([appDelegate.player respondsToSelector:@selector(loadState)]) { [appDelegate.player setControlStyle:MPMovieControlModeVolumeOnly]; [appDelegate.player setFullscreen:YES]; [appDelegate.player prepareToPlay]; }- (void)loadStateDidChange:(NSNotification *)notification { [[NSNotificationCenter defaultCenter]removeObserver:self name:MPMoviePlayerLoadStateDidChangeNotification object:appDelegate.player]; }
Thanks in Advance