ionic cordovaFile error“ENCODING_ERR”

时间:2017-01-03 07:37:34

标签: ionic-framework ngcordova

我正在使用离子1的社交应用程序。我需要图片和视频上传。对于图片,一切正常,但无法对视频做同样的事情。这是我的代码:

_self.videoFromDrive = function(){     navigator.camera.getPicture(_self.onSuccess,_self.onFail,{       质量:100,       destinationType:Camera.DestinationType.FILE_URI,       sourceType:Camera.PictureSourceType.PHOTOLIBRARY,       mediaType:Camera.MediaType.VIDEO     });   };

_self.onSuccess = function(videoURL){     _self.selectedVideo = videoURL;     _self.dpPic1 = _self.selectedVideo.substring(0,_self.selectedVideo.lastIndexOf('/')+ 1);     _self.dpPic2 = _self.selectedVideo.substring(_self.selectedVideo.lastIndexOf('/')+ 1,_self.selectedVideo.length);   };

_self.onFail = function(err){     generalService.toastMessage('错误!Someth enter code here出错了','long');   };

我正在使用$ cordovaFile.readAsArrayBuffer(_self.dpPic1,_self.dpPic2),但却失败了

1 个答案:

答案 0 :(得分:0)

我认为该插件存在问题。为什么不尝试

<input type="file" id="file">

在旧浏览器Android中不支持某些更改。为此你可能需要CrossWalk。