I would like to play a video with a transparent background. The only thing is that all the information I found on the internet is "how to make the video background transparent", but the background of my video is already transparent, now I need to make the background of the player transparent. How do I do that? I tried this:
NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"New Project 5" ofType:@"m4v"];
NSLog(@"%@",resourcePath);
NSURL *url = [NSURL fileURLWithPath:resourcePath];
NSLog(@"%@",url);
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
moviePlayer.shouldAutoplay=YES;
moviePlayer.controlStyle = MPMovieControlStyleNone;
[moviePlayer setFullscreen:NO animated:YES];
[self.view addSubview:moviePlayer.view];
moviePlayer.view.frame = CGRectMake(200, 600, 400, 300);
[moviePlayer play];
moviePlayer.view.backgroundColor = [UIColor clearColor];
for(UIView *aSubView in moviePlayer.view.subviews) {
aSubView.backgroundColor = [UIColor clearColor];
}
But it doesn't work. It displays a black background.