我有一个应用程序,我正在按一下按钮播放电影。我的电影是透明的。当我点击按钮时,我的电影可以正常播放,但问题是它的背景色保持白色。我希望电影的背景颜色是透明的。这是我玩电影的代码。播放透明背景的电影
-(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];
}
参考[this](http://stackoverflow.com/questions/1401517/iphone-sdk-how-to-play-a-video-with-transparency)link.hope你得到你的答案 –
rani can u post该拍摄 – iLearner
@Bhurudada我可以给你发电影 – Rani