2017-08-31 3 views

答えて

0

cordovaFileTransferプラグインを使用すると、キャプチャしたビデオファイルを希望する場所に送信できます。

$scope.captureVideo = function() { 
    var options = { limit: 3, duration: 15 }; 

     $cordovaCapture.captureVideo(options).then(function(videoData) { 
     // Success! Video data is here 
     /** following is sample usage to upload the video to server.**/ 
        path = videoData[0].localURL; 
        var options = new FileUploadOptions(); 
        options.fileKey = "uploadfile";     
        options.fileName = videoData[0].name; 
        options.mimeType = "video/mp4"; 
     $cordovaFileTransfer.upload("video-upload-url", path, options).then(function (result) { 

       //Success! Video file uploaded to destination. 

        }, function (err) { 
         console.log(err); 
        },     
        function (progress) { 
         if (progress.lengthComputable) { 
         } else {} 
        }); 
     }, function(err) { 
     // An error occurred. Show a message to the user 
     }); } 

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media-capture/

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file-transfer/index.html

関連する問題