Ionic Native Camera select Video on iOS not working

I’m developing a App with Ionic 2 and I’m have problems with @ionic-native/Camera. I’ve this code on Upload.ts.

let loader = this.loading.create({
  content: 'Carregando video....'
});
loader.present().then(() => {
  const options: CameraOptions = {
    quality: 100,
    destinationType: this.camera.DestinationType.FILE_URI,
    sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
    mediaType: this.camera.MediaType.VIDEO,
  }
  this.camera.getPicture(options).then((videoData) => {
      this.uploadForm.controls['file'].setValue(videoData)
      loader.dismiss();
    }, (err) => {
      console.log(err);
  });
});

This code works fine in Android, but when I run ionic cordova run ios -lc, the promise this.camera.getPicture(options) is never resolved, so the loader keep running forever.

Thanks in advance!

Well the problem is with the apache cordova camera plugin it provides the temporary path to the video file to come out from this error implement below changes in camera plugin.

in CDVCamera.m change THIS:

(CDVPluginResult*)resultForVideo:(NSDictionary*)info
{
NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString];
return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePath];
}

to THIS:

(CDVPluginResult*)resultForVideo:(NSDictionary*)info
{
NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];

NSArray* spliteArray = [moviePath componentsSeparatedByString: @"/"];
NSString* lastString = [spliteArray lastObject];
NSError *error;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"tmp"];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:lastString];
[fileManager copyItemAtPath:moviePath toPath:filePath error:&error];

return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:filePath];
}

Hope it will help you.

And ofcourse you should perform this also

 if (this.platform.is('android')) {
    filePath = 'file:///' + this.uploadForm.controls['file'].value;
  } else {
    filePath = this.uploadForm.controls['file'].value;
  }