ALAssetsLibrary enumerateGroupsWithTypes:ALAssetsGroupPhotoStream doesn't contain videos in the group

994 views Asked by At

The photo stream groups return a count of 0 when filtering for videos. Here's the code to reproduce:

ALAssetsGroupType groupTypes = ALAssetsGroupPhotoStream;
ALAssetsFilter* assetTypes = [ALAssetsFilter allVideos];
ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];

ALAssetsLibraryAccessFailureBlock failureBlock = ^(NSError *error)
{
};

ALAssetsLibraryGroupsEnumerationResultsBlock enumGroupsBlock = ^(ALAssetsGroup *group, BOOL *stop)
{
    if (group)
    {
        [group setAssetsFilter:assetTypes];
        NSString* name = [group valueForProperty:ALAssetsGroupPropertyName];
        NSUInteger count = group.numberOfAssets;
        NSLog(@"name: %@, count: %lu", name, (unsigned long)count);
    }
};

[library enumerateGroupsWithTypes:groupTypes usingBlock:enumGroupsBlock failureBlock:failureBlock];

This happens with both the 'My Photo Stream' and the Shared Streams. Note that the Photos app does display the videos. Also note that filtering for photos (using [ALAssetsFilter allPhotos] above) does work. I've reproduced this on iOS 7.1.2 and 8.1.

Has anyone else seen this or found a workaround? Thanks!

Update (Oct 29, 2014): My Photo Stream does not support video, only the Shared Streams do.

2

There are 2 answers

2
gabbler On

From this link

Which photo formats does My Photo Stream support?

My Photo Stream supports JPEG, TIFF, PNG, and most RAW photo formats. My Photo Stream doesn't work with video.

On my iPhone, there is no video in My Photo Stream album but only photos.

1
holtmann On

My PhotoStream never includes videos only photos. Shared Photo Streams however can contain videos. iCloud Photo Library is not fully supported in AssetsLibrary - you may switch to PhotoKit to get full iCloud Photo Library support.