MPMoviePlayerViewController Generating lots of errors

I am having issues to get MPMoviePlayerViewController to work. I have a new project that after viewDidLoad I try to play the movie in a moviePlayerViewController as below. I get the movie to play put I get lots and lots of error messages as below. Can someone explain what I am doing wrong to get these errors

- (void)viewDidLoad
{
    [super viewDidLoad];
    [ self play ];
}

- (void) play {
    NSURL *filmURL = [ NSURL URLWithString:@"http://www.ud-ltd.com/ipmt/Film16.mp4" ];
    self.mvc = [[MPMoviePlayerViewController alloc] initWithContentURL:filmURL ];
    [ self presentMoviePlayerViewControllerAnimated:self.mvc ];
    [ self.view addSubview:self.mvc.view ];
    [ self.mvc.moviePlayer play];
}

The error messages

Jan  8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextSaveGState: invalid context 0x0
Jan  8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextClipToRect: invalid context 0x0
Jan  8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextTranslateCTM: invalid context 0x0
Jan  8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextDrawShading: invalid context 0x0
Jan  8 21:19:28 rezas-macbook.home MoviePlayer[30320] <Error>: CGContextRestoreGState: invalid context 0x0
2013-01-08 21:19:28.526 MoviePlayer[30320:c07] [MPAVController] Autoplay: Disabling autoplay for pause
2013-01-08 21:19:28.527 MoviePlayer[30320:c07] [MPAVController] Autoplay: Disabling autoplay
2013-01-08 21:19:28.528 MoviePlayer[30320:c07] Warning: Attempt to present <MPMoviePlayerViewController: 0x916ec10> on <ViewController: 0x916c9c0> whose view is not in the window hierarchy!
2013-01-08 21:19:28.536 MoviePlayer[30320:c07] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)
2013-01-08 21:19:29.864 MoviePlayer[30320:c07] [MPAVController] Autoplay: Enabling autoplay
2013-01-08 21:19:29.868 MoviePlayer[30320:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
2013-01-08 21:19:29.868 MoviePlayer[30320:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
2013-01-08 21:19:29.870 MoviePlayer[30320:c07] [MPAVController] Autoplay: Enabling autoplay
2013-01-08 21:19:29.871 MoviePlayer[30320:c07] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
2013-01-08 21:19:30.964 MoviePlayer[30320:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
2013-01-08 21:19:30.964 MoviePlayer[30320:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
2013-01-08 21:19:31.494 MoviePlayer[30320:c07] [MPAVController] Autoplay: _streamLikelyToKeepUp: 0 -> 1
2013-01-08 21:19:31.495 MoviePlayer[30320:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 1
2013-01-08 21:19:31.495 MoviePlayer[30320:c07] [MPAVController] Autoplay: Enabling autoplay

I am also using MPMoviePlayerViewController to play live video in one of my App & I also

getting these errors but besides these errors my video is playing fine with this player.

I think there is no solution for it. If your video is working fine then ignore these warnings

or errors.


(1) To solve the CGContextSaveGState , wrap your alloc-init in a fake graphics context, as I explain here:

iphone MPMoviePlayerViewController CGContext Errors

(2) The other messages are harmless, and are now resolved on iOS 6.1. They no longer appear.


I also using the MPMoviePlayerViewController to live video on my app and getting same above list errors.And I found MPMoviePlayer not support larger data to show video but if you used smaller data of video is working fine its not give any error. In fact is not problem of prepare to play and play property of movie player.

If you need to show larger data then used webview on your app.

链接地址: http://www.djcxy.com/p/66326.html

上一篇: 如何正确实施iAds? iOS6弃用问题

下一篇: MPMoviePlayerViewController生成很多错误