我调用 doPlayMovie 方法在 iPad 上播放一些文件,但是当我按下 Home 按钮尝试将我的应用程序切换到后台时,播放器自动关闭。
有什么办法可以让玩家一直在那里不解雇?
-(MPMoviePlayerViewController*)moviePlayerController{
if(!_moviePlayerController){
_moviePlayerController = [[MPMoviePlayerViewController alloc]init];
}
return _moviePlayerController;
}
-(MPMoviePlayerController*)moviePlayer{
return self.moviePlayerController.moviePlayer;
}
-(void)doPlayMovie:(NSString *)filepath{
self.moviePlayerController = nil;
NSURL *playUrl = [NSURL fileURLWithPath:filepath];
self.moviePlayer.contentURL = playUrl;
[self.moviePlayer play];
[self presentMoviePlayerViewControllerAnimated:self.moviePlayerController];
}