我有一个应用程序,我通过单击按钮播放电影。我的电影是透明的。当我单击按钮时,我的电影可以正常播放,但问题是它的背景颜色仍然是白色。我希望电影的背景颜色是透明的。这是我播放电影的代码。
-(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];
}