-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[file-system][ios] Fix copying movies from assets not working #11749
Conversation
[[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], |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?"
There was a problem hiding this comment.
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.
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