1

I was following the advice from Scott Rogers in a previous posting "MPMoviePlayerViewController customization". I have a requirement to display only the 'DONE' button in the interface controls of MPMoviePlayerViewController. As I understand, it is not possible to access objects in the standard control, you can only set the control style - hence I have created a custom control myself with an xib file, with LAF as the standard only but with only a done button. I have added the control view over the player thus:

self.vCtr.view.frame=CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height-20);
[self.mPlayer.view addSubview:self.vCtr.view];

and then faded it after a couple of seconds:

[self performSelector: @selector(fadeControl) withObject: nil afterDelay: 2.0];

However I'm unsure how to properly emulate the fade-out-after-2sec and fade-in-with user-click-on-video-window, and this is what I'd appreciate some help with please. Should I:

  1. fade the control to a very small alpha (0.1?) so I can capture a click in that view controller (I believe people have said this is not good)
  2. fade the control to hidden, then create a transparent button the same size as the movie view that when clicked, fades in the custom control view again?

I think (2) is the recommended way to go, but if so could someone help with implementation? Should the button be between the custom control and the movie view in terms of hierarchy? Can I create it programmatically, and if so where do I define the event handler?

Thanks for any pointers (newbie iOS programmer)

Community
  • 1
  • 1
eggfish
  • 65
  • 1
  • 7
  • I believe I have solved it, but I would appreciate some validation by an expert. I used method 2: adding a transparent button to the movieplayer view, and in the selector unhiding the custom control. My fading logic uses a CATransition fade animation, which I understand is the recommended method to use. Thanks. – eggfish Jun 30 '13 at 17:04

0 Answers0