Hello,
Welcome to our Microsoft Q&A platform!
If you want to get all video file in your device, you can use Xamarin.Essentials: File Picker to achieve this.
The FilePicker
class lets a user pick a single or multiple files from the device.
If you desire your user to pick multiple files you can call the FilePicker.PickMultipleAsync()
method. It also takes in PickOptions
as a parameter to specify additional information. The results are the same as PickAsync
, but instead of a single FileResult an IEnumerable<FileResult>
is returned that can be iterated over.
You can refer to the following code:
var pickResult = await FilePicker.PickMultipleAsync(new PickOptions
{
FileTypes = FilePickerFileType.Videos,
PickerTitle = "Pick video(s)"
});
if (pickResult != null)
{
foreach (FileResult item in pickResult)
{
System.Diagnostics.Debug.WriteLine(" path =" + item.FullPath); // here we can get the full path
}
}
For more details, you can check: https://learn.microsoft.com/en-us/xamarin/essentials/file-picker?context=xamarin%2Fandroid&tabs=android
Best Regards,
Jessie Zhang
---
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our [documentation][3] to enable e-mail notifications if you want to receive the related email notification for this thread.