3
내 app.so에서 iPod 비디오에 액세스 할 수없는 응용 프로그램에서 작업 중입니다. iTunes.so를 통합하여 비디오를 다운로드 할 수 있다고 생각합니다. iTunes Store에서 가져 와서 로컬 디렉토리에 저장하면 해당 디렉토리에서 비디오를 재생할 수 있습니다.ipunes에서 iTunes 라이브러리 구현
나는 /////////////////////
-(IBAction)SelectVideo:(id)sender
{
UIImagePickerController *ImageVideoPicker = [[UIImagePickerController alloc] init];
ImageVideoPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
ImageVideoPicker.delegate = self;
[ImageVideoPicker setMediaTypes:[NSArray arrayWithObjects:(NSString *)kUTTypeMovie, nil]];
/////////videoLibrary is PopOver to show Videos Of photo gallery////////
VideoLibrary= [[UIPopoverController alloc]
initWithContentViewController:ImageVideoPicker];
[VideoLibrary presentPopoverFromRect:addVideo.frame inView:self.videoView permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
에서 재생할 수 popOverController에 사진 갤러리에서 동영상을 재생할 수는 없지만 ///////////////////// function이 비디오를 선택했습니다 ///////////////////
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
if ([mediaType isEqualToString:@"public.movie"]){
NSURL *videoURL = [info objectForKey:UIImagePickerControllerMediaURL];
UIAlertView *alurl=[[UIAlertView alloc]initWithTitle:@"message" message:videoURL delegate:self cancelButtonTitle:@"ok" otherButtonTitles:@"cancel", nil];
[alurl show];
[alurl release];
//////////////this url is used to play video in
app.VideoUrl=videoURL;
NSLog(@"%@",app.VideoUrl);
}
[picker dismissModalViewControllerAnimated:YES];
}
나는이 app.videoUrl.So에서 놀 수 없다. 누군가가 iTunes Store 통합을 완료했다면 올바른 방향으로 나를 가리 키도록한다. 감사
가 음악을 다루는 유사한 SO 질문은, 그러나있는 MPMediaPickerController를 사용의 좋은 예를 보여줍니다 http://stackoverflow.com/questions/1665119/how-to-play-a-song-from-the-itunes-library-in-iphone –