Edited remote version from the header, but it started with iOS 8.1
I have an application that I created to play videos from Photos.app users. When I install the application on device 8.0.2, I return the list of videos from the [PHAsset fetchAssetsWithMediaType: options:] call without problems, but when I install the same code on device 8.1, I get 0 videos. Has anyone come across this? Has the method of accessing photos / videos changed again from Photos.app photos?
PHFetchOptions *options = [[PHFetchOptions alloc] init];
PHFetchResult *videos = [PHAsset fetchAssetsWithMediaType:PHAssetMediaTypeVideo options:options];
Any help would be appreciated.
Update
My code has been changed to use the PHAssetCollection call to try and get the album, and I get some success, now in both versions I get 3 of my 6 videos (unfortunately, not every time 3 times).
PHFetchResult *collection = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumSyncedAlbum options:options];
PHFetchResult *videos = [PHAsset fetchKeyAssetsInAssetCollection:collection[0] options:nil];
Edit # 2
Well, I just saw my mistake in the code above, and I leave it to everyone who does the same stupidity as I do. My video extraction line triggers a “key” activation, so I only get 3.
PHFetchResult *collection = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAlbumSyncedAlbum options:options];
PHFetchResult *videos = [PHAsset fetchAssetsInAssetCollection:collection[0] options:nil];
source
share