Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selected file should have a property to hold path of the actual file. #104

Closed
junedmmn opened this issue Sep 9, 2022 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@junedmmn
Copy link

junedmmn commented Sep 9, 2022

Summary

Whenever we select or pick a media file using MediaGallery.PickAsync(), the result must have a property that holds the path of the actual file we selected. The result is of type MediaPickResult that has a property named Files. This File is IEnumerable<IMediaFile> and IMediaFile has properties listed below:

public interface IMediaFile : IDisposable
{
    string NameWithoutExtension { get; }
    string Extension { get; }
    string ContentType { get; }
    MediaFileType? Type { get; }
    Task<Stream> OpenReadAsync();
}

Hence, as shown, it doesn't have any property showing path of the actual file that we selected. It is much required feature as we can further operate on the picked file like compressing, showing preview such as thumbnails, and for showing video previews. We can also inject Dependency Services for platform specific functions.

The only thing now we can do is copy the stream to a file using Stream.CopyToAsync(). But this creates a duplicate copy of an already existing file. This takes a long time for video files depending on the size. This is not the proper way, it's just a workaround.

Adding a feature to provide file path of the selected file will be much appreciable. Thanks.

@junedmmn junedmmn added the enhancement New feature or request label Sep 9, 2022
@dimonovdd
Copy link
Owner

Hi. Duplicate
#41
#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants