---
title: "How to get videos using ALAssetsLibrary in iOS?"  
description: "How to get videos using ALAssetsLibrary in iOS?"  
author: "Royce Roy"  
published: 2015-12-21  
updated: 2015-12-21  
canonical: https://www.mindstick.com/forum/33763/how-to-get-videos-using-alassetslibrary-in-ios  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# How to get videos using ALAssetsLibrary in iOS?

I was [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to get videos from the photo [library](https://www.mindstick.com/forum/34615/software-framework-vs-library) because I also want to get [images](https://www.mindstick.com/interview/1067/what-is-the-php-predefined-variable-that-tells-the-what-type-of-images-that-php-support) list so I am using ALAssetsLibrary. I have successfully get images from the photo library. But I have getting [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) with the [video](https://www.mindstick.com/articles/290133/6-necessary-preparations-you-need-before-editing-a-video) because I am not [understanding](https://www.mindstick.com/articles/12918/cat-5e-vs-cat-6a-understanding-the-major-differences) how can I do this.\
Please help me.

## Replies

### Reply by Tarun Kumar

For getting videos ALAssetsFilter class is very helpful during enumeration on group,\
Here is an example:

```
ALAssetsLibrary* library = [[ALAssetsLibrary alloc] init];[library enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) {    if(group){        [group setAssetsFilter:[ALAssetsFilter allVideos]];        [group enumerateAssetsUsingBlock:^(ALAsset *asset, NSUInteger index, BOOL *stop){            if (asset){                NSDictionary *meta = [[asset defaultRepresentation] metadata];            }        }];    }} failureBlock:^(NSError *error) {    NSLog(@"Enumerating problem with AssetLibrary groups %@", error);}];
```

We can also filter **allPhotos**, **allAssets** instead of **allVideos**.


---

Original Source: https://www.mindstick.com/forum/33763/how-to-get-videos-using-alassetslibrary-in-ios

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
