GitToTheHub commented on code in PR #942:
URL:
https://github.com/apache/cordova-plugin-camera/pull/942#discussion_r2724746925
##########
src/ios/CDVCamera.m:
##########
@@ -865,21 +804,116 @@ - (void)resultForImage:(CDVPictureOptions*)options
- (CDVPluginResult*)resultForVideo:(NSDictionary*)info
{
NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL]
absoluteString];
+
// On iOS 13 the movie path becomes inaccessible, create and return a copy
if (IsAtLeastiOSVersion(@"13.0")) {
- moviePath = [self createTmpVideo:[[info
objectForKey:UIImagePickerControllerMediaURL] path]];
+ moviePath = [self copyFileToTemp:[[info
objectForKey:UIImagePickerControllerMediaURL] path]];
}
+
return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsString:moviePath];
}
-- (NSString*)createTmpVideo:(NSString*)moviePath
+/**
+ Generates a unique temporary file path for a file extension.
+
+ The filename is prefixed with `cdv_photo_` and suffixed with the provided
+ file extension. A UNIX timestamp (seconds since 1970) is used to ensure
Review Comment:
This plugin only supports selecting one file at a time, but I changed it
anyway to use milliseconds for a unique file name, that makes more sense. Good
catch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]