视频下载0字节离子1

时间:2018-07-02 10:30:39

标签: ionic-framework cordova-plugins

当我下载视频时,它以0字节的形式存储在手机内存中,这是我下载视频的代码

  $cordovaFileTransfer.download(url, targetPath, {}, true).then(function(result) {
                                               //On successful transfer try and extract the file object
                                               result.file(function (file) {
                                                   var localFile = file.localURL;
                                                   resolveLocalFileSystemURL(localFile, function (entry) {
                                                       var nativePath = entry.toURL();
                                                       // Open in another app, will fail if app doesn't exist that can open the mime type
                                                      console.log('native path:'+nativePath);
                                                   }, function(error) {
                                                       //handle error here
                                                       console.log('error intro'+error);
                                                   });
                                               }, function (error) {
                                                   // handle error here
                                               });
                                           }, function (err) {
                                               //handle error here
                                           });

0 个答案:

没有答案