You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/24 21:08:33 UTC

[GitHub] [cordova-plugin-camera] markerio commented on issue #506: iOS13 file_uri error picking video from gallery

markerio commented on issue #506: iOS13 file_uri error picking video from gallery
URL: https://github.com/apache/cordova-plugin-camera/issues/506#issuecomment-557928177
 
 
   @saurabhDuzumaki @neerajsaxena0711 Please find below the simplest implementation of picking a video from the camera roll in iOS13. Tested in all v13 releases including the latest v13.2.3. First, setup the plugin to retrieve a video from the device's gallery. The picker should be triggered as follows:
   ```
   navigator.camera.getPicture(onSuccess, onFail, {
     saveToPhotoAlbum: false,
     correctOrientation: true,
     allowEdit: false,
     mediaType: Camera.MediaType.VIDEO,
     sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
     destinationType: Camera.DestinationType.FILE_URI
     });
   ```
   The success callback should be as follows:
   ```
   function onSuccess(fileURI) {
     // fix path for file:// protocol
     fileURI = (parseInt(fileURI.indexOf('file://'))==0)?fileURI:'file://'+fileURI;
     // resolve and locate file
     window.resolveLocalFileSystemURL(fileURI, function success(fileEntry) {
       // retrieve file entry
       fileEntry.file(function(fileObj) {
         // debug
         console.log(fileEntry.nativeURL);
         console.log(fileObj.localURL);
         console.log(fileObj.name);
         console.log(fileObj.size);
         // continue from here
         // ...
         // ...
       }, function(error) {
         console.log('file entry error');
         });
     }, function (error) {
       console.log('resolve error');
       });
     }
   ```
   Please reply back if you find this helpful. Hope this helps.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org