I used Xcode 6 with iOS 8 SDK.
If the video can't played, when starting MPMoviePlayer. MPMoviePlayerPlaybackDidFinishNotification not working.
I reference this article: [How to get an error description when playback fails on MPMoviePlayerController but iOS8 doesn't work.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPFinished: ) name:MPMoviePlayerPlaybackDidFinishNotification object:self.MoviePlayer];
How to do that can solve this problem? Thanks.
I had same issue and the only solution I found was to replace the MPMoviePlayerController by a AVPlayerViewController (available since iOS 8 in the AVKit framework).
Make sure the "object" parameter is of class MPMoviePlayerController and not MPMoviePlayerViewController.
If self.MoviePlayer is a MPMoviePlayerViewController, just change this:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(MPFinished:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:self.MoviePlayer];
to this:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(MPFinished:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:self.MoviePlayer.moviePlayer];
The object sending the notification is self.MoviePlayer.moviePlayer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With