cordova-plugin-mediaPicker icon indicating copy to clipboard operation
cordova-plugin-mediaPicker copied to clipboard

Video selection not working in ios device

Open Sawannrl123 opened this issue 6 years ago • 3 comments

Hi,

We have use this plugin, Working fine with android but in ios creating some listed issue.

  • selection of only photos work fine.
  • selection of mixed(photos & Videos) doesn't give any result.
  • selection of only video also doesn't give any result.

When I inspect the issue then found that its not going inside this (exportSession exportAsynchronouslyWithCompletionHandler) function so the below functionality is not working.

We have xcode 10.1 and testing on device iphone 6 with ios version 12.1.

Thanks for building this plugin.

Kindly assist ASAP.

Sawannrl123 avatar Jan 22 '19 10:01 Sawannrl123

It works on iOS platform successfully for me.

You should watch out using results' uri element for android and path element for ios. My getMedias function block is like this:

MediaPicker.getMedias(args, function (medias) {
    results = medias;
    var fullPath;
    if (ionic.Platform.platform() == 'ios') {
        fullPath = _.pluck(medias, 'path');
     } else if (ionic.Platform.platform() == 'android') {
        fullPath = _.map(_.pluck(medias, 'uri'), function(uri) { return '/' + uri });
    }
    $scope.media = {
        mediatype: 1,
        fullPath: fullPath
    };
}, function (e) {
        console.error(e)
});

If it does not help you to solve your problem, please provide your code and so we can help you in the right way. Good luck.

denizhacisalihoglu avatar Jan 28 '19 12:01 denizhacisalihoglu

@Sawannrl123 @denizhacisalihoglu i test on xcode 10 ios 12.1 ,is work,but return result slow when selected video is large,because the video mast move to sandbox and transcoding compression to MP4。

this Listener for compression event //ios Video transcoding compression to MP4 Event(use AVAssetExportPresetMediumQuality) document.addEventListener("MediaPicker.CompressVideoEvent", function(data) { alert(data.status + "||" + data.index); }, false);

DmcSDK avatar Feb 01 '19 05:02 DmcSDK

Or you have better suggestions on IOS。tell me。 Thanks

DmcSDK avatar Feb 01 '19 05:02 DmcSDK