我使用MPMoviePlayerController在一个小盒子里显示一部电影。默认控件允许用户切换到全屏。一切都很完美,但全屏模式下的控件有黑色背景,状态栏显示,看起来很奇怪。
_moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:resourceURL];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackComplete:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:_moviePlayerController];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayerWillExitFullscreen:)
name:MPMoviePlayerWillExitFullscreenNotification
object:nil];
_moviePlayerController.view.frame = CGRectZero; // will be set to correct size later
_moviePlayerController.view.layer.borderWidth = kVideoBorderWidth;
_moviePlayerController.view.layer.borderColor = kVideoBorderColor.CGColor;
_moviePlayerController.scalingMode = MPMovieScalingModeAspectFit;
_moviePlayerController.controlStyle = MPMovieControlStyleDefault;
_moviePlayerController.shouldAutoplay = NO;
[_contentView addSubview:_moviePlayerController.view];
我附上截图,有什么想法吗?
非常感谢!