Movie Player shows in iOS 4.3 but not in iOS 5.0


I really enjoy the book and I am learning a lot.

I download the sample code from the website. The Movie Player appears when executing the code on the iPhone 4.3 Simulator, but the Movie Player does NOT appear when executing the code on the iPhone 5.0 Simulator.

I cannot determine what the problem is.

I have the same problem with the code that I entered. I compared my code with the download using diff with and I have not difference except I made my code ARC compliant by commenting out all the retain, release, autorelease messages.

Does anyone have any ideas?


I can’t say if this works in iOS 4.3, but it’s not working for me in iOS 5.0.

No errors, all seems OK in the code. Only see a black space on the screen where the controller should be.

Though I should add: it does work if you instantiate a MPMoviePlayerViewController instead of the MPMoviePlayerController.


From the iOS 5.0 release notes:

Movie Player
Starting in iOS 5.0, in order to facilitate finer-grained playback control, a movie player is not automatically prepared to play upon creation. Call the prepareToPlay method to prepare the movie player. For more information, see MPMoviePlayerController Class Reference.

so in your init method, after instantiating your moviePlayer, add this:

[moviePlayer prepareToPlay];

works like a champ.