MPMoviePlayer Audio Album art

I am streaming an MP3 file using MPMoviePlayer and I would like the image to appear in the background instead of the default Quicktime logo.

I figured out a way to overlay an image on the player, but the problem with that is you need to go outside of the image in order to display the player controls. And when they appear, they are under the image.

Does anyone know how to do this?

Thanks, John

+1


a source to share


4 answers


Most applications on the iPhone are made from a hierarchy of views. You can go to the top root of the video player node and recursively view the child views and set the value hidden

to YES until you find the element you want, then paste UIImageView

below that element. This way the controls stay on top and still respond to user inputs.

You run the risk if Apple changes the UI MPMoviePlayer

and reshuffles the view hierarchy, but you'll probably have a lot of advance notice and can fix your app to allow the new layout.



The question is whether this is kosher for appstore apps, but many current apps (especially cameras / snapshots) do this to get rid of the standard window elements.

0


a source


backgroundColor is deprecated and diving into private View structures is dangerous. This works great for me:



        UIImageView *coverImageView = [[UIImageView alloc] initWithImage:coverImage];
        coverImageView.contentMode = UIViewContentModeScaleAspectFit;
        coverImageView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        coverImageView.frame = moviePlayerController.view.bounds;
        [moviePlayerController.view addSubview:coverImageView];

      

+2


a source


Use AVAudioPlayer and implement your own user interface.

0


a source


it will work, check this

MPMoviePlayerController *moviePlayerController=[[MPMoviePlayerController alloc] initWithContentURL:theURL];
moviePlayerController.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Default.png"]];

      

0


a source







All Articles