I am trying to record video with cordova media capture plugin and then open the file with Filesystem.readFile(). When I try to run the following code, It seems to hang on the function call.
import { MediaCapture } from ‘@ionic-native/media-capture/ngx’;
import { FilesystemDirectory, FilesystemEncoding, Plugins } from ‘@capacitor/core’;
const { Filesystem } = Plugins;
async getVideo() {
let data = await this.mediaCapture.captureVideo({ limit: 1 });
let fileInfo = data[0];
let file = await Filesystem.readFile({
path: fileInfo.fullPath.replace('file://', '')
});
console.log('file read');
console.log(file);
}
If anyone can give me some guidance, it would be very much appreciated. Thanks.