我的代碼播放視頻文件時出現問題。每當我以全屏模式播放文件時,播放不會佔用我的全部屏幕。下面是相關代碼:MPMoviePlayerController全屏模式問題
NSURL *url = [NSURL fileURLWithPath:@"Somefile.mov"];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
[moviePlayer setFullscreen:YES];
moviePlayer.view.frame = self.switchView.frame;
[self.switchView addSubview:moviePlayer.view];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(movieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(playbackStateDidChange:)
name:MPMoviePlayerPlaybackStateDidChangeNotification
object:moviePlayer];
[moviePlayer prepareToPlay];
[moviePlayer play];
這裏是輸出我得到:
嘗試這一個,而不是你正在設置的框架moviePlayer.view.frame = self.switchView.bounds; – Ravin 2011-04-17 09:56:04
現在看來下方的酒吧處於正確的位置,但頂部酒吧仍然較低。 http://img849.imageshack.us/i/defaultj.png/ – Diurpaneus 2011-04-17 11:23:48