2011-01-20 69 views

回答

2

使用Assests庫。請參閱this答案

編輯:

在谷歌上搜索,我發現this方法來訪問視頻使用圖像拾取控制器

+0

您好,感謝的答覆,是資產產生庫是唯一的選擇? – SriPriya 2011-01-20 10:22:09

0

首先添加MediaPlayer框架...

然後下載型MP4的視頻從mobile9.com

然後使用代碼如下

NSString *url=[[NSBundle mainBundle] pathForResource: @"video" ofType:@"mp4"]; 

MPMoviePlayerController *play1= [[MPMoviePlayerController alloc] initWithContentURL:[NSURL 
fileURLwithPath:url]; 

[play1 setOrientation:UIDeviceOrientationPortrait animated:YES]; 

[paly1 play]; 

試試這個代碼.....它的工作..

0
to select video from photo library use following code: 
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; 
    imagePicker.delegate = self; 
    imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 
    imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil]; 

    [self presentViewController:imagePicker animated:YES completion:NULL]; 
相關問題