I'm trying to play a video using MPMoviePlayerController. On some iPads, the video plays, on other iPads it does not.
Here is the code:
NSURL *url = [NSURL fileURLWithPath:[self videoPath]];
self.moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:url];
self.moviePlayerController.view.frame = self.view.bounds;
self.moviePlayerController.repeatMode = MPMovieRepeatModeOne;
self.moviePlayerController.controlStyle = MPMovieControlStyleNone;
[self.moviePlayerController prepareToPlay];
... add to subview, play ...
MPMoviePlayerController lists the following compression restrictions:
H.264 Baseline Profile Level 3.0 video, up to 640 x 480 at 30 fps. (The Baseline profile does not support B frames.)
MPEG-4 Part 2 video (Simple Profile)
Originally, we were using H.264 at a higher resolution and the video worked with some our testers. Unfortunately, I was unable to get the video to play on my iPad (4th Generation). We kept the existing resolution and tried MPEG-4 Part 2 video but again, the video did not work. The only way we could get the video to work reliably was drastically reducing the resolution down to 480 x 640. The result looks horrible.
I added the notifications to monitor the load state and for the videos that failed to work, the modes would go from MPMovieLoadStateUnknown
to MPMovieLoadStatePlayable
back to MPMovieLoadStateUnknown
. The videos that worked fine would go from MPMovieLoadStateUnknown
to MPMovieLoadStatePlayable
to MPMovieLoadStatePlayable|MPMovieLoadStatePlaythroughOK
.
I checked the errorLogs and accessLogs and they were both empty.
Any thoughts on what I might check next in order to get the higher resolution video to work on the iPads?