简体   繁体   中英

Change color of modal presented MPMoviePlayerViewController in iOS7?

Is it possible to customize the appearance of the MPMoviePlayerViewController controls when presented modally in iOS7? I really don't care for the default look in iOS7 and was wondering if I could brighten up the buttons a little bit. I figured this would be pretty basic but I can't find any documentation on it. I am presenting my MPMoviePlayerViewController from a button action. Here is my code:

-(void)playVideo:(id)sender
{
    MPMoviePlayerViewController *mpvc = [[MPMoviePlayerViewController alloc]initWithContentURL:self.movieURL];
    [self presentMoviePlayerViewControllerAnimated:mpvc];
    [mpvc.moviePlayer play];
}

There is no documented way to adjust the appearance of the interface of MPMoviePlayerController (or its wrapping brother, MPMoviePlayerViewController ). Apple does not support such actions.

You got two obvious options:

White Hat

A. disable the standard interface and recreate it yourself

  • may sound simple but the full functionality of that standard interface in fact is not THAT trivial to recreate. Maybe you get off by implementing the most important parts which is doable without big headaches.

Black Hat

B. hack into the views and adjust them

  • this is subject to being rejected or getting your app broken with each and every new iOS release. You wont need that much time to get that done - less than a day.

Well, there is also the option of not using MPMoviePlayerController at all but using AVFoundation based classes directly. That will give you extreme flexibility but it will also force you to write pretty much code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM