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

[file-system][ios] Fix copying movies from assets not working #11749

Merged

Conversation

lukmccall
Copy link
Contributor

Why

Fixes copying movies from assets not working.

How

When we dealing with videos, we need to change the method that gets data from an asset. Otherwise, iOS will return data of one frame.

Test Plan

Changelog

  • Fixed copying movies from assets not working on iOS

@github-actions
Copy link
Contributor

Native Component List for this branch is ready

[[PHImageManager defaultManager] requestAVAssetForVideo:asset options:nil resultHandler:^(AVAsset *asset, AVAudioMix *audioMix, NSDictionary *info) {
if (![asset isKindOfClass:[AVURLAsset class]]) {
reject(@"ERR_INCORRECT_ASSET_TYPE",
[NSString stringWithFormat:@"File '%@' has incorrect asset type.", from],
Copy link
Contributor

Choose a reason for hiding this comment

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

would this be an incorrect asset type from the user? If so, can we include what the expected asset type is in the error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be only triggered when the system doesn't have the URL for the asset - for example, if it's store in the cloud. But if that is the case, I don't think you can obtain a valid URL - so the copy function shouldn't be triggered without downloading the asset itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, so it's unlikely a user would run into this error? I bring it up because if I received the error message File <my file> has incorrect asset type. as a user, my first question would be "What should I do differently?"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it'll be very unlikely.

@lukmccall lukmccall merged commit 30b8fdc into master Feb 1, 2021
@lukmccall lukmccall deleted the @lukmccall/file-system/copy-movie-from-asset-doens-work branch February 1, 2021 14:35
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.

2 participants