MPMoviePlayerViewController生成很多错误

我有问题要使MPMoviePlayerViewController工作。 我有一个新的项目,在viewDidLoad之后,我尝试在moviePlayerViewController中播放电影,如下所示。 我看电影玩,我得到很多很多错误消息,如下所示。 有人可以解释我做错了什么来获得这些错误

- (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];
}

错误消息

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

我也使用MPMoviePlayerViewController在我的App&I中播放实况视频

得到这些错误,但除了这些错误,我的视频播放这个播放器罚款。

我认为它没有解决办法。 如果您的视频正常工作,请忽略这些警告

或错误。


(1)为了解决CGContextSaveGState ,将你的alloc-init包装在一个假的图形上下文中,正如我在这里解释的:

iPhone MPMoviePlayerViewController CGContext错误

(2)其他消息是无害的,现在在iOS 6.1上解决。 他们不再出现。


我还使用MPMoviePlayerViewController在我的应用程序中实时播放视频,并获取上面列表中的错误。我发现MPMoviePlayer不支持显示视频的较大数据,但如果您使用较小的视频数据,则工作正常,不会给出任何错误。 实际上并不是准备玩电影播放器​​的属性的问题。

如果你需要显示更大的数据,然后在你的应用中使用webview。

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

上一篇: MPMoviePlayerViewController Generating lots of errors

下一篇: AppleKeyboards in iOS6