ボタンのクリックでムービーを再生するアプリケーションがあります。私の映画は透明です。ボタンをクリックすると、ムービーは正しく再生されますが、背景色が白のままです。動画の背景色を透明にしたい。これは、映画を再生するための私のコードです。
-(IBAction)ClickFunny:(id)sender
{
NSString *url = [[NSBundle mainBundle]
pathForResource:@"Moviename"
ofType:@"mov"];
MPMoviePlayerController *playerController =
[[MPMoviePlayerController alloc]
initWithContentURL:[NSURL fileURLWithPath:url]];
playerController.controlStyle =MPMovieControlStyleNone;
playerController.scalingMode = MPMovieScalingModeAspectFill;
playerController.fullscreen = YES;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:playerController];
playerController.view.frame = CGRectMake(84, 250, 150, 10);
[self.view addSubview:playerController.view];
[playerController play];
}
- (void) movieFinishedCallback:(NSNotification*) aNotification {
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player stop];
[player.view removeFromSuperview];
[player autorelease];
}