MPMoviePlayer is not playing video. I'm running iOS 7 and getting the same error on the device and simulator:
2013-10-02 12:49:18.246 xxxx[688:60b] _itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
}
I've tried playing a video from the internet and file system, but no luck. My code is very straightforward:
self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:@"http://stream.qtv.apple.com/events/mar/123pibhargjknawdconwecown/12oihbqeorvfhbpiubqnfv3_650_ref.mov"]];
self.moviePlayer.view.frame = self.view.bounds;
self.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
[self.view addSubview:self.moviePlayer.view];
[self.moviePlayer prepareToPlay];
The URL listed is a valid movie: http://stream.qtv.apple.com/events/mar/123pibhargjknawdconwecown/12oihbqeorvfhbpiubqnfv3_650_ref.mov
I've also tried using MPMoviePlayerViewController, but that didn't work either.
MPMovieSourceTypeStreaming
seems to be buggy on iOS 7. On my app, I'm streaming a video from the web (same as you), and the problem disappear with this source type :
self.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
I know it's strange because we're streaming the video, but this is the only solution that works for me.
Hope it helps :)
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