투명한 배경을 가진 비디오를 내 앱 안에서 재생하고 싶습니다. 그것에는 투명 배경 위에서 움직이는 남자가 있습니다. 유일한 문제는 MPMovieePlayer가 검은 색 배경을 가진 것처럼 보입니다. 어떻게 투명하게 만들 수 있습니까?투명 배경을 가진 MPMoviePlayerViewController 비디오
이 I 시도한 코드 :
-(void)playMovie
{
NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"syncink movie" ofType:@"m4v"];
NSLog(@"%@",resourcePath);
NSURL *url = [NSURL fileURLWithPath:resourcePath];
NSLog(@"%@",url);
MPMoviePlayerViewController *moviePlayer;
moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
moviePlayer.moviePlayer.shouldAutoplay=YES;
moviePlayer.moviePlayer.controlStyle = MPMovieControlStyleNone;
[moviePlayer.moviePlayer setFullscreen:NO animated:YES];
[self.view addSubview:moviePlayer.view];
moviePlayer.view.frame = CGRectMake(200, 600, 400, 300);
[moviePlayer.moviePlayer play];
moviePlayer.view.backgroundColor = [UIColor clearColor];
for(UIView *aSubView in moviePlayer.view.subviews)
{
aSubView.backgroundColor = [UIColor clearColor];
}
}
하지만
aSubView.backgroundColor = [UIColor clearColor];
실제 배경이 아닌 플레이어의 프레임을 제거하는 것처럼 보입니다. 어떤 도움을 주셔서 감사합니다.