This code does not set the background view of a MPMoviePlayerController
in iOS6 but works perfectly in iOS7.
UIView *patternView = [[UIView alloc] initWithFrame:self.view.bounds];
patternView.backgroundColor = [UIColor redColor];
UIImageView *imgView=[[UIImageView alloc]initWithFrame:self.view.bounds];
imgView.image=imgBackGround;
[patternView addSubview:imgView];
[self.moviePlayer.backgroundView addSubview:patternView];
What is the alternative?
You are ultimately setting the view with background color red.If you only wants set the background color,then instead of taking any view and adding it, set its MPMoviePlayerController view's background color directly.
[self.moviePlayer.view setBackgroundColor:[UIColor redColor]];