私はこの方法を持っています:
-(void) playMov: (NSString*) title{
// play a movie!!
NSString *movpath = [[NSBundle mainBundle] pathForResource:title ofType:@"mp4"];
self.mpviewController =[[MPMoviePlayerViewController alloc]initWithContentURL:[NSURL fileURLWithPath:movpath]];
[self.mpviewController.view setFrame: CGRectMake(0, 0, self.view.frame.size.width, 275)];
self.mpviewController.view.backgroundColor = [UIColor clearColor];
[self.mpviewController.view setBackgroundColor:[UIColor clearColor]];
[self.view addSubview:mpviewController.view];
MPMoviePlayerController *mp = [mpviewController moviePlayer];
mp.contentURL = [NSURL fileURLWithPath:movpath];
CGRect playerFrame = CGRectMake(0, 0, self.view.frame.size.width, 275);
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerPlaybackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:mp];
[mp.view setFrame:playerFrame];
mp.view.backgroundColor = [UIColor clearColor];
[mp prepareToPlay];
[[mpviewController moviePlayer] play];
}
ビューが初めて読み込まれるとき - 背景が黒の全画面表示です。最初は希望のサイズ(0、0、self.view.frame.size.width、275)になった後、まだ黒い背景です。毎回このサイズで背景色がくっきりして欲しいです。
何か案は??