「写真」のアルバムから映画を再生するにはどうすればよいですか?UIImagePickerControllerを使用して映画を閲覧したくありませんが、次のコードのように映画の名前(またはある種のID)を指定して再生できるようにしたいと思います。以下のコードは、ビデオをローカルで再生します。写真アプリに保存されている「ビデオ」というアルバムのビデオを再生するためのパスを変更するにはどうすればよいですか?ご協力いただきありがとうございます。
NSString *url = [[NSBundle mainBundle]
pathForResource:@"Movie1"
ofType:@"MOV"];
MPMoviePlayerViewController *playerViewController =
[[MPMoviePlayerViewController alloc]
initWithContentURL:[NSURL fileURLWithPath:url]];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(movieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:[playerViewController moviePlayer]];
[playerViewController.view setFrame: self.view.bounds];
[self.view addSubview:playerViewController.view];
MPMoviePlayerController *player = [playerViewController moviePlayer];
[player play];
[playerViewController release];