我有一個應用程序,我正在按一下按鈕播放電影。我的電影是透明的。當我點擊按鈕時,我的電影可以正常播放,但問題是它的背景色保持白色。我希望電影的背景顏色是透明的。這是我玩電影的代碼。播放透明背景的電影
-(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