iOS MPMoviePlayerController控件在切换到全屏时显示黑色背景

时间:2012-10-18 18:26:35

标签: iphone ios mpmovieplayercontroller

我使用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];

我附上截图,有什么想法吗?

enter image description here enter image description here

非常感谢!

0 个答案:

没有答案