0
"사진"에있는 앨범의 동영상을 어떻게 재생합니까? 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];