Skip to content

Commit 34d5b69

Browse files
committed
Update the Example to request video poster as well
1 parent a81a160 commit 34d5b69

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Example/SDWebImagePhotosPlugin/MasterViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibB
5959
PHImageRequestOptions *options = [PHImageRequestOptions new];
6060
options.sd_targetSize = CGSizeMake(500, 500); // The original image size may be 4K, we only query the max view size :)
6161
SDWebImagePhotosLoader.sharedLoader.imageRequestOptions = options;
62+
// Request Video Asset Poster as well
63+
SDWebImagePhotosLoader.sharedLoader.requestImageAssetOnly = NO;
6264

6365
// Photos Library Demo
6466
[self fetchAssets];
@@ -73,7 +75,6 @@ - (void)fetchAssets {
7375
options:nil];
7476
PHAssetCollection *collection = result.firstObject;
7577
PHFetchOptions *fetchOptions = [PHFetchOptions new];
76-
fetchOptions.predicate = [NSPredicate predicateWithFormat:@"mediaType = %d", PHAssetMediaTypeImage];
7778
fetchOptions.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO]];
7879
PHFetchResult<PHAsset *> *assets = [PHAsset fetchAssetsInAssetCollection:collection options:fetchOptions];
7980
for (PHAsset *asset in assets) {

0 commit comments

Comments
 (0)