I wrote this code using the captureVideo() method from the Ionic Native MediaCapture plugin.
Here is the file path I obtained:
/private/var/mobile/Containers/Data/Application/95DB5A64-700B-4E3D-9C2C-562C46520BEC/tmp/52515367181__BBC39D42-69EC-4384-A36F-7A512E109329.MOV
My goal is to copy this file to the document directory.
CreateVide(){
//SET CAPTUREVIDEO OPTION
let videooption:CaptureVideoOptions = {limit:1};
//CAPTURE VIDEO AND GET MEDIAFILE
this.mediaCapture.captureVideo().then((videoData:Array<MediaFile>)=>{
//SAVE AS FILE
let filedir = this.file.documentsDirectory ;
//Create directory
this.file.createDir(filedir,'recordvideo',false);
//SAVE FILE
// this.file.writeFile(filedir + 'recordvideo', 'sample.mov', videoData[0]. );
console.log('success:'+ videoData[0].fullPath);
var ind = (videoData[0].fullPath.lastIndexOf('/')+1);
var orgFilename = videoData[0].fullPath.substring(ind);
var orgFilePath = videoData[0].fullPath.substring(0,ind);
console.log(orgFilename, orgFilePath,filedir + 'recordvideo');
this.file.copyFile(orgFilePath, orgFilename, filedir + 'recordvideo','sample.mov');
});
}
Do you think it's achievable? Any assistance would be greatly appreciated.