File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -513,9 +513,22 @@ - (void)resultForImage:(CDVPictureOptions*)options info:(NSDictionary*)info comp
513
513
- (CDVPluginResult*)resultForVideo : (NSDictionary *)info
514
514
{
515
515
NSString * moviePath = [[info objectForKey: UIImagePickerControllerMediaURL] absoluteString ];
516
+ // On iOS 13 the movie path becomes inaccessible, create and return a copy
517
+ if (IsAtLeastiOSVersion (@" 13.0" )) {
518
+ moviePath = [self createTmpVideo: [[info objectForKey: UIImagePickerControllerMediaURL] path ]];
519
+ }
516
520
return [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString: moviePath];
517
521
}
518
522
523
+ - (NSString *) createTmpVideo : (NSString *) moviePath {
524
+ NSString * moviePathExtension = [moviePath pathExtension ];
525
+ NSString * copyMoviePath = [self tempFilePath: moviePathExtension];
526
+ NSFileManager * fileMgr = [[NSFileManager alloc ] init ];
527
+ NSError *error;
528
+ [fileMgr copyItemAtPath: moviePath toPath: copyMoviePath error: &error];
529
+ return [[NSURL fileURLWithPath: copyMoviePath] absoluteString ];
530
+ }
531
+
519
532
- (void )imagePickerController : (UIImagePickerController*)picker didFinishPickingMediaWithInfo : (NSDictionary *)info
520
533
{
521
534
__weak CDVCameraPicker* cameraPicker = (CDVCameraPicker*)picker;
You can’t perform that action at this time.
0 commit comments