2011-01-20 70 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]; 
相关问题