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

Fix getAssetInfoAsync does not return localUri for videos #5806

Merged
merged 2 commits into from Oct 3, 2019

Conversation

lukmccall
Copy link
Contributor

Why

Resolve #2448.

How

For video files, to get additional information we need to use requestAVAssetForVideo method.

Test Plan

options:options
resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {
AVURLAsset *urlAsset = (AVURLAsset *)asset;
result[@"localUri"] = [[urlAsset URL] absoluteString];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything else available in AVURLAsset that we can export to JS?
Also, it might be worth to update the documentation as well that we don't provide orientation when the mediaType is different than photo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AVUrlAssets doesn't provide anything useful.

In our documentation, in the description column of orientation property, we have this:
Display orientation of the image. Is it not enough?

Copy link
Member

@tsapeta tsapeta Sep 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rephrase it to make it clearer for users:

Orientation is available only for assets whose mediaType is MediaType.photo

Also, maybe we can infer the orientation based on the video dimensions? 🤔

@lukmccall lukmccall force-pushed the @lukmccall/media-library-fix-get-local-uri branch from 0f3ac01 to 4a6bd66 Compare September 30, 2019 10:46
@tsapeta tsapeta merged commit 24e78d5 into master Oct 3, 2019
@tsapeta tsapeta deleted the @lukmccall/media-library-fix-get-local-uri branch October 3, 2019 13:55
cruzach pushed a commit that referenced this pull request Oct 3, 2019
…eos (#5806)

# Why

Resolve #2448.

# How

For video files, to get additional information we need to use `requestAVAssetForVideo` method.

# Test Plan

- https://snack.expo.io/@lukaszkosmaty/medialibrary.getassetinfoasync-does-not-return-localuri-for-mediatype-%22video%22 - now display `local Uri` property for both images and videos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ios] MediaLibrary.getAssetInfoAsync does not return localUri for mediaType "video"
2 participants