MPMovieControlStyleNone
我需要在播放小视频期间禁用全部用户交互,我已经尝试将控件的样式设置为UIView
无MPMoviePlayerController
我关闭了视频,但它仍在后台播放,而且用户交互被禁用。以下是我的做法:
-(IBAction)startGame:(id)sender
{
NSURL * url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Teste" ofType:@"m4v"]];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
moviePlayer.controlStyle = MPMovieControlStyleNone;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
mBlankView = [[UIView alloc] initWithFrame:moviePlayer.view.frame];
mBlankView.userInteractionEnabled = NO;
[mBlankView setMultipleTouchEnabled:NO];
[mBlankView setBackgroundColor:[UIColor clearColor]];
[self.view addSubview:mBlankView];
}