【发布时间】:2013-12-16 14:27:10
【问题描述】:
我正在制作一个相机应用程序,我想在其中访问用户在其 iPhone 上创建的所有视频。
目前我拥有的代码仅从用户相机胶卷中获取视频。我的一些用户抱怨他们在相册应用程序下创建了多个自定义文件夹,并且他们在其中存储了一些视频。由于我的代码只查看相机胶卷,它不会从其他文件夹中提取电影。我可以访问他们的其他文件夹吗?
这是我目前所拥有的。
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop)
{
[group enumerateAssetsUsingBlock:^(ALAsset *alAsset, NSUInteger index, BOOL *innerStop)
{
if (alAsset)
{
ALAssetRepresentation *representation =[alAsset defaultRepresentation];
NSURL *url = [representation url];
NSString *assetType=[alAsset valueForProperty:ALAssetPropertyType];
//videos only
if ([assetType isEqualToString:@"ALAssetTypeVideo"])
{
.....
【问题讨论】:
-
尝试将此类 assetsGroupType 用作“ALAssetsGroupAll”。
标签: ios iphone objective-c video alassetslibrary