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];
指定された最初のリンクでビデオが再生されるのに、サーバーでは再生されないのは奇妙です。私が送信したリンクにアクセスすると、ビデオ ファイルは有効で、同じものです...なぜ機能しないのかわかりません。ご協力いただきありがとうございます!