Search code examples
iosmpmovieplayercontrollerloadingcgcontext

iOS 6 - MPMoviePlayerViewController generates CGContext errors and is stuck on 'Loading...'


Was working fine earlier, but for some reason I am getting all these issues. The URL is correct and is for an MP4 file.

Code:

[movieView.moviePlayer setContentURL:videoLink];
[movieView.moviePlayer prepareToPlay];
[self presentViewController:movieView animated:YES completion:nil];

Log:

   <Error>: CGContextSaveGState: invalid context 0x0
   <Error>: CGContextClipToRect: invalid context 0x0
   <Error>: CGContextTranslateCTM: invalid context 0x0
   <Error>: CGContextDrawShading: invalid context 0x0
   <Error>: CGContextRestoreGState: invalid context 0x0

EDIT

Looks like the CGContext errors are a bug in the framework, so not much to do about those. But still don't understand the 'Loading..' error. I have verified the URLs and they all play the videos fine on web browsers. And logging the URL of the movieplayer shows the correct one. Ideas?


Solution

  • Turns out the issue with playback was low connectivity that wasn't being detected by my reachability methods.