MPMoviePlayerController breaks/stops after going to fullscreen in iOS6

snod picture snod · Sep 26, 2012 · Viewed 19.8k times · Source

I have a MPMoviewPlayerViewController embedded into an UIView object. When I start the player in the embedded mode everything works fine and as expected. If the user then taps onto the fullscreen toggle (or if I change to fullscreen programmatically using setFullscreen:animated) the player goes fullscreen, the movie plays for another second and after that the screen goes black with only a "Loading..." message.

This behavior only appears using iOS 6 (also iPad 6.0 Simulator), on devices running iOS 5 everything works as intended.

The movie source is a local file from the app bundle.

Upon playing & entering fullscreen the debug output is as follows:

2012-09-26 15:24:48.251 [39895:c07] [MPAVController] Autoplay: Disabling autoplay for pause
2012-09-26 15:24:48.252 [39895:c07] [MPAVController] Autoplay: Disabling autoplay
2012-09-26 15:24:48.262 [39895:c07] [MPAVController] Autoplay: Enabling autoplay
2012-09-26 15:24:48.265 [39895:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
2012-09-26 15:24:48.266 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
2012-09-26 15:24:48.267 [39895:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
2012-09-26 15:24:48.268 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
2012-09-26 15:24:48.276 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
2012-09-26 15:24:48.286 [39895:c07] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
2012-09-26 15:24:48.938 [39895:c07] [MPAVController] Autoplay: Enabling autoplay
2012-09-26 15:24:48.940 [39895:c07] [MPAVController] Autoplay: Enabling autoplay
2012-09-26 15:24:48.954 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
2012-09-26 15:24:49.006 [39895:c07] [MPAVController] Autoplay: Enabling autoplay
2012-09-26 15:24:49.012 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)

Has somebody an idea why the player stops working?

Edit: Added an example project on github

Answer

lobianco picture lobianco · Sep 26, 2012

Are you stopping the video in viewWillDisappear: or viewDidDisappear:? Those methods get called when a video enters fullscreen on iOS 6, but not on any earlier iOS versions (a report has been filed at Open Radar for this "bug"). I posted this temporary solution on a similar question:

My temporary solution until the bug is fixed is to check the player's fullscreen Boolean value in viewWillDisappear: and/or viewDidDisappear:. If it returns YES, the movie is entering fullscreen mode and you should refrain from doing anything that might interrupt it.