Ionic - iOS - Store the Path to file in Photo library


#1

Working on Ionic app, I’m trying to store and reuse a path to video in the iOS photo library. Using the Ionic-native camera plugin. However, each time I open a video, it generates and provides a new path with new uuid in tmp folder. Xcode log example:

   2018-06-06 16:10:11.062655+0800 file:///private/var/mobile/Containers/Data/Application/B3C0CDB7-6B2D-4F32-8C0C-632AE0D8FC79/tmp/BFDDB5BC-7F0B-42E5-B943-E5F9EAF25FB5.MOV

Here is my code:

      openGallery() {
    console.log('open gallery');
    let cameraOptions = {
      mediaType: MediaType.ALLMEDIA,
      sourceType: PictureSourceType.PHOTOLIBRARY,
      destinationType: DestinationType.NATIVE_URI,
      quality: 100,
      targetWidth: 600,
      targetHeight: 600,
      encodingType: EncodingType.JPEG,
      correctOrientation: true
    }

    return new Promise<any>((resolve, reject) => {
      this.camera.getPicture(cameraOptions)
        .then(file_uri => {
          if (this.platform.is('android')) {
            file_uri = "file://" + file_uri;
          }
          console.log("openGallery >> " + file_uri)
          resolve(file_uri);
        }, err => {
          console.log(err)
          reject(err)
        });
    })
}

Is there any way to store a path to existing video in library without making a copy in the app folder?