Я хочу преобразовать URI пути к файлу в объект файла для загрузки в хранилище Filebase. Но после того, как я выбрал видео и позвонил
window.resolveLocalFileSystemURL (...)
никогда не предупреждает File и uploadToFirebase () не вызывает. Итак, я не знаю, как это сделать.
doGetPicture() {
// TODO:
// get picture from camera
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
mediaType: this.camera.MediaType.VIDEO,
}
this.camera.getPicture(options).then((_imagePath) => {
alert('got image path ' + _imagePath);
window.resolveLocalFileSystemURL(_imagePath, function (fileEntry) {
fileEntry.file(function (file) {
alert('got file! '+file);
console.log('File__++ ', file);
});
});
});
}
uploadToFirebase(file) {
// Create the file metadata
var metadata = {
contentType: 'video/mp4'
};
// Upload file and metadata to the object 'videos/test.mp4'
this.fbRef.child('videos/' + file.name).put(file, metadata);
}
Спасибо
PS. Я использую Ionic v.4