我正在尝试将视频文件上传到Firebase存储。由于某种原因,文件没有上载到存储中,我还缺少什么? 我正在使用Mediafilepicker插件从图库中选择视频,然后将该视频文件发送到Firebase存储
我还没有发现类似的问题(nativescript-angular)
let mediafilepicker = new Mediafilepicker();
mediafilepicker.openVideoPicker(options);
mediafilepicker.on("getFiles", (res) => {
let results = res.object.get('results');
if (results) {
this.videoFileUrl = [];
for (let i = 0; i < results.length; i++) {
let result = results[i];
let file = result.file;
this.vidPath = file;
this.vid = file
let filename = (new Date).getTime().toString() + ".mp4";
let new_path = fs.path.join(fs.knownFolders.currentApp().path, "/app/images/");
let folder = fs.Folder.fromPath(new_path);
let path = fs.path.join(folder.path, file);
this.videoFileUrl.push(file);
console.log(path);
}
}
});
mediafilepicker.on("error", (res) => {
let msg = res.object.get('msg');
console.log(msg);
});
mediafilepicker.on("cancel", (res) => {
let msg = res.object.get('msg');
console.log(msg);
});
setInterval(() => {
// require view to be updated
this.ref.markForCheck();
}, 500);
}
显示0个错误
我希望它可以上传视频