If you do not assign a newly created instance of MPMoviePlayerController
to anything other than a variable with a local scope ( moviePlayer
), then the movie will be released before the movie starts playing. (I believe that calling thumbnailImageAtTime
holds it a little longer.)
Try assigning a movie player instance a saved (strong) variable or instance property. Of course, it should be released when done, as multiple instances of the player do not work well.
Also note that with iOS 5, prepareToPlay
. The following is chapter 28 of Matt Neuberg. IOS 5 Programming Second Edition:
Before you can display a movie in your interface using MPMoviePlayerController, you must call prepareToPlay, which is provided through the MPMediaPlayer protocol (adopted by MPMoviePlayerController). This requirement is new in iOS 5 and is a significant difference from previous versions of the system; your old code may break if it did not make this call.
source share