ドキュメント フォルダ内のファイルを表示するアプリケーションを 1 つ作成します。ドキュメントフォルダーから表示したい.mov形式のファイルが1つありますが、アプリを実行して再生ボタンをクリックすると、このムービーが表示されず、次の画像が表示されます。
これは私のコードです:(私を導き、私の間違いを教えてください)
- (IBAction)Play:(id)sender
{
NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES)objectAtIndex:0];
NSString *file = [documentPath stringByAppendingPathComponent:@"xcode4-outlet.mov"];
NSURL *url = [NSURL fileURLWithPath:file];
_moviePlayer = [[MPMoviePlayerController alloc]initWithContentURL:url];
[self.view addSubview:_moviePlayer.view];
_moviePlayer.fullscreen = YES;
_moviePlayer.shouldAutoplay = YES;
_moviePlayer.allowsAirPlay = YES;
[_moviePlayer play];
}
また、コンパイラは私にこのメッセージを受け取ります:
movie player[9489:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0
movie player[9489:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up.
movie player[9489:c07] [MPAVController] Autoplay: Enabling autoplay
movie player[9489:c07] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
movie player[9489:c07] [MPAVController] Autoplay: Enabling autoplay