I am making an iPhone app, where in there is a requirement for embedding video into the app. I am using MPMoviePlayerController class instance to play the video inside my iPhone app. Now how to stop the video and come back to the application when the video finishes?
Right now even after the video finishes the moviePlayer ( i.e. instance of MPMoviePlayerController) remains open.
Please Help and Suggest.
You to register for an NSNotification that the MPMoviePlayerController sends out when it finishes. Here is an example:
A good place to put that is inside “viewDidLoad” of your main ViewController class.
Then inside your method “movieFinishedCallback:” (which gets an NSNotification object passed in as an argument, which you can use to find our more detail about the kind of finishing that happened if you like) you simply dismiss the movieplayercontroller.