MPMoviePlayerViewController产生大量错误的(MPMoviePlayerVi

2019-07-18 00:32发布

我有问题得到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

Answer 1:

我也使用MPMoviePlayerViewController在我的应用程序和我也是一个玩视频直播

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

我觉得有没有为它的解决方案。 如果您的视频工作正常,则忽略这些警告

或错误。



Answer 2:

(1)为了解决CGContextSaveGState ,包裹在一个假的图形上下文的页头,初始化,因为我在这里说明一下:

iphone MPMoviePlayerViewController CGContext上的错误

(2)其它的消息是无害的,并且现在已经得到解决在iOS 6.1。 他们不再出现。



Answer 3:

我也使用MPMoviePlayerViewController住在我的应用程序的视频和获得相同上面所列内容errors.And我发现MPMoviePlayer不支持更大的数据显示视频,但如果你使用的视频的较小的数据是工作的罚款它不给任何错误。 其实是不准备在玩和播放电影播放器​​的性能的问题。

如果你需要显示大数据,然后使用你的应用程序的WebView。



文章来源: MPMoviePlayerViewController Generating lots of errors