在一个视图中,我有这个代码来全屏播放电影:
NSURL *movieURL = [NSURL URLWithString:@"http://stream.qtv.apple.com/events/jan/1201oihbafvpihboijhpihbasdouhbasv/12pibasvpqihbsdfvihbasdv01_iphone_vod_ref.mov"];
self.mpc = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
NSLog(@"self mpc: %@", self.mpc);
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:self.mpc ];
self.mpc.moviePlayer.movieSourceType = MPMovieSourceTypeUnknown;
self.mpc.moviePlayer.shouldAutoplay = YES;
self.mpc.view.frame = self.view.frame;
[self.view addSubview:self.mpc.view];
self.mpc.moviePlayer.fullscreen = YES;
[self.mpc.moviePlayer play];
使用此代码调用视图本身
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone"
bundle: nil];
TestViewController *controller = [mainStoryboard
instantiateViewControllerWithIdentifier: @"testController"];
[self presentModalViewController:controller animated:YES];
电影播放正常,但在顶部有一些 MPMoviePlayerViewController 没有使用的空间。
这是显示问题的屏幕截图:https ://www.dropbox.com/s/1dje2ar6ynk6855/IMG_2447.PNG
(我已将 testController 视图的背景设为黄色)
这部电影怎么能全屏播放?