2
votes

I'm using simple MPMoviePlayerController. In portrait mode it is emmbedded into my layout. When I rotate my device I want it to go full screen. In full screen mode there is a done button but only thing it does is pausing the video. I want to dismiss modal view controller when the done button is tapped. How can I do this?

I've tried:

  1. Putting a [UIColor clearColor] on a background of a button and place a button over Done button thus intercept touch event into my own selector. It failed because my custom button isn't displayed when MPMoviePlayerController is in fullscreen mode.

  2. Going to notification center and trying to catch "willExitFullscreen" but it won't occur (pressing done button when in landscape fullscreen mode isn't goint out from the fullscreen mode).

  3. Finding done button in the MPMoviePlayerController... but I was unable to find it.

Using MPMoviePlayerViewController isn't an option as I want to be able to use embedded player in my controller when i Portrait mode, and be able to rotate movie without loading it from scratch (so pushing new controller when user changes device orientation isn't right solution for me).

I've read a few topics on this issue and question can be the same or similar but anserws require either things I've checked (i.e. notifications) or things I can't use (MPMoviePlayerViewController).

ANSWER (as I am unable to post it in 7h) Heh ok..

The culprit of this whole mess was this line of code

[self.mpPlayer setControlStyle:MPMovieControlStyleFullscreen];

So it seems that setting Fullscreen control style when going into fullscreen mode will break done button....

Makes no sense to me. But when I commented out this line I am able to recive willExitFullscreen notification and I can work with that.

1

1 Answers

0
votes

The culprit of this whole mess was this line of code

[self.mpPlayer setControlStyle:MPMovieControlStyleFullscreen];

So it seems that setting Fullscreen control style when going into fullscreen mode will break done button....

Makes no sense to me. But when I commented out this line I am able to recive willExitFullscreen notification and I can work with that.