MPMoviePlayerViewController, remove quick time symbol / add background image?

I have an MPMoviePlayerViewController that plays audio. I would like to remove the Quicktime logo and / or add a custom background image to the player, but retain the playback controls. I swear I did it earlier than before iOS 5, but I can’t repeat it! Things I tried:

- Adding a routine to MPMoviePlayerViewController. Puts subview OVER on playback controls, but not good.

-setBackgroundColor moviePlayer with a template. Doing nothing.

-setView on all MPMoviePlayerViewController. As expected, the playback controls and navigation bar disappeared. I suppose this might work, but I would need to recreate all the playback controls manually, but I really would not want to.

Can anyone shed some light?

+4
source share
2 answers

Check the MPMoviePlayerController backgroundView property.

From Class Reference MPMoviePlayerController ;

backgroundView

Customized presentation, content displayed behind the movie. (Only for reading)

@property (non-atomic, read-only) UIView * backgroundView

The discussion view provides supporting content over which the content of the movie is displayed. You can add subviews to the background if you want to display custom background content.

This view is part of the view hierarchy returned by the view property.

Availability Available in iOS 3.2 and later. Announced in MPMoviePlayerController.h

Try something like this (assuming your MPMoviePlayerController instance is called moviePlayerController ):

 patternView = [[UIView alloc] initWithFrame:self.view.bounds]; patternView.backgroundColor = [UIColor redColor]; [moviePlayerController.backgroundView addSubview:patternView]; [patternView release]; 
+8
source

Until the answer is correct for iPhoneOS 3. This has changed in iOS 4 and 5.

Now Apple has added the readonly property to MPMoviePlayerViewController, providing MPMovieController. MPMovieController has a backgroundView that should be used.

Now you need to do something like this:

 patternView = [[UIView alloc] initWithFrame:self.view.bounds]; patternView.backgroundColor = [UIColor redColor]; [moviePlayerController.moviePlayer.backgroundView addSubview:patternView]; [patternView release]; 
+2
source

Source: https://habr.com/ru/post/1383983/


All Articles