1

可能重复:
MPMoviePlayerViewController 生成大量错误

我正在尝试在 iOS6 上使用 MPMovieViewController 播放电影,并在我的控制台中收到以下消息:

Nov  1 17:44:19 Kamrans-MacBook-Pro.local HoosierAgToday[58188] <Error>: CGContextSaveGState: invalid context 0x0
Nov  1 17:44:19 Kamrans-MacBook-Pro.local HoosierAgToday[58188] <Error>: CGContextClipToRect: invalid context 0x0
Nov  1 17:44:19 Kamrans-MacBook-Pro.local HoosierAgToday[58188] <Error>: CGContextTranslateCTM: invalid context 0x0
Nov  1 17:44:19 Kamrans-MacBook-Pro.local HoosierAgToday[58188] <Error>: CGContextDrawShading: invalid context 0x0
Nov  1 17:44:19 Kamrans-MacBook-Pro.local HoosierAgToday[58188] <Error>: CGContextRestoreGState: invalid context 0x0
2012-11-01 17:44:19.412 HoosierAgToday[58188:c07] [MPAVController] Autoplay: Disabling autoplay for pause
2012-11-01 17:44:19.412 HoosierAgToday[58188:c07] [MPAVController] Autoplay: Disabling autoplay
2012-11-01 17:44:19.422 HoosierAgToday[58188:c07] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0)
2012-11-01 17:44:19.630 HoosierAgToday[58188:c07] [MPAVController] Autoplay: Enabling autoplay
2012-11-01 17:44:19.634 HoosierAgToday[58188:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
2012-11-01 17:44:19.635 HoosierAgToday[58188:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
2012-11-01 17:44:19.637 HoosierAgToday[58188:c07] [MPAVController] Autoplay: Enabling autoplay
2012-11-01 17:44:19.638 HoosierAgToday[58188:c07] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
2012-11-01 17:44:19.646 HoosierAgToday[58188:c07] [MPAVController] Autoplay: Enabling autoplay

当我尝试从以下 URL 播放它时: http: //clips.vorwaerts-gmbh.de/big_buck_bunny.mp4它可以工作。当我下载这个确切的文件并将其放在我们的服务器上时http://loadoutnews.co/hat/default/download/post.videoios.afa1cc6b18aa0e03.6269675f6275636b5f62756e6e792e6d7034.mp4它不能正常工作并给我这些错误。如果需要,我确保 URL 有效并且正确地进行了 % 转义。这是我必须播放视频的代码:

//video 5
        NSDictionary *dict = [list objectAtIndex:indexPath.row];
        NSString *escapedValue = [NSString stringWithFormat:@"%@%@",@"http://loadoutnews.co/hat/default/download/",[dict objectForKey:@"videoios"]];
        escapedValue = [escapedValue stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:escapedValue]];
        [player.view setBounds:self.view.bounds];
        [self presentModalViewController:player animated:YES];
        //I have tried it with and without this line below
        [player.moviePlayer play];
        [player release];

我觉得奇怪的是它确实在给定的初始链接上播放视频,但不在我们的服务器上。如果你转到我发送的链接,视频文件是有效的并且是同一个......我不明白为什么它不起作用。谢谢你的帮助!

4

0 回答 0