显示存储在文档目录中的所有视频 [英] display all videos stored in document directory

查看:99
本文介绍了显示存储在文档目录中的所有视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从照片库将视频存储在我的文档目录中.现在,我想显示存储在我的文档目录中的所有视频..但是我不知道这怎么可能??? 实际上,我想将所有视频显示为在图库中打开的所有视频(一行中有四个视频)..当我单击任何视频时...该视频开始播放...

I stored videos in my document directory from photo library. Now i want to show all videos which are stored in my document directory.. but i don't know how its possible??? Actually i want to display all videos as like its open in photo library(four videos in a single row).. and when i click on any video... the video is start playing...

有人可以帮助我吗?这是将所有视频从文档目录显示到ViewController的最佳方法.... 谢谢...

can anybody help me which is the best way to show all videos from document directory to ViewController.... Thanx......

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
 {
    NSURL * movieURL = [info valueForKey:UIImagePickerControllerMediaURL] ;
    NSData * movieData = [NSData dataWithContentsOfURL:movieURL];
    NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); 
    NSString *documentsDirectory = [documentPaths objectAtIndex:0];
    NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:[[self imageNameTextField]text]];
    fullPath = [fullPath stringByAppendingFormat:@".MOV"];
    [ movieData writeToFile:fullPath atomically:YES]; 

}

推荐答案

我建议您使用开源的网格视图控件.您可以在GitHub中找到它们.例如, BDDynamicGridViewController 很有趣.但这不是唯一的选择.还有 AQGridView .

I recommend you to use an open-source grid-view control. You can find them in GitHub. For instance, BDDynamicGridViewController is interesting. But it is not the only option. There is also AQGridView.

此外,还有一个流行的开源库,名为 Three20 ,它已经进行了升级,叫做雨云.该库具有用于显示照片网格的自定义控件.您可以将其用于显示视频缩略图网格.例如,尝试

Also, there is a popular open-source library, called Three20 and it has it's upgrade, called Nimbus. This library has a custom control for displaying photos grid. You can use the same for displaying video thumbnails grid. For instance, try this.

在设法使用或创建Grid视图控件后,将需要视频的缩略图生成器.为此,请使用本主题 .

After you will manage to use or create Grid view control, you will need thumbnail generator for the videos. Use this topic for that purpose.

这篇关于显示存储在文档目录中的所有视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆