Search code examples
iosmpmovieplayercontroller

iOS MPMoviePlayer triggers random action after leaving fullscreen


I have a wired issue where my MPMoviePlayer triggers, at least it seems like, an action when leaving fullscreen. Actually it repeats the animation that happened before. I recorded it because it is hard to explain, here is the video http://www.youtube.com/watch?v=CNzRItQhD8M

Any idea what is happening?


Solution

  • Even though this certainly can only be a guess, I still am rather convinced that your problem is a pretty common pitfall of MPMoviePlayerController.

    I would be looking very closely at your viewWillAppear/viewDidAppear implementations.

    Remember that those are invoked whenever a view is getting visible and that happens also when the fullscreen playback is ending / switched back to embedded mode as that reveals your views (again).

    Make sure that any animations actions you are triggering within these methods are only triggered when needed.

    A very well suited signal would be the fullscreen property of MPMoviePlayerController. Within your appearance callbacks, check if that propery is set to YES and if so, do not start the unwanted actions.