我正在尝试使用普通视频标签通过cordova / ionic / angular在android和ios上播放本地保存的视频文件。我在这个问题上花了很多小时,无法发挥任何作用。请帮忙!这是我的代码。我已经以多种方式确认了视频文件的存在。这些checkDirs均返回true。
this.file.checkDir(this.file.dataDirectory, 'ja_JP').then(res => {
this.file.checkDir(this.file.dataDirectory + 'ja_JP/', '994007046').then(resp2 => {
this.file.checkFile(this.file.dataDirectory + 'ja_JP/' + '994007046/', 'c2f5f11b-45c5-
4c15-9b04-a8aedb24a06f.mp4').then(resp3 => {
if (resp3) {
this.dialogVideoPath = (this.file.dataDirectory + 'ja_JP/' + '994007046/' +
'c2f5f11b-45c5-4c15-9b04-a8aedb24a06f.mp4');
// This doesn't work, this gives me a 404, but I have confirmed the file does
exist at this path.
(http://10.0.0.44:8100/data/user/0/com.missionlanguage.tall/files/ja_JP/994007303/e26bc992-db60-4908-ba5f-8749f506326f.mp4)
// stripping 'file://' from the beginning doesn't work (404)
// leaving 'file://' doesn't work either. resp: not allowed to load local
resource
(file:///data/user/0/com.missionlanguage.tall/files/ja_JP/994007046/c2f5f11b-45c5-4c15-9b04-a8aedb24a06f.mp4)
}
this.file.readAsDataURL(this.file.dataDirectory + 'ja_JP/' + '994007046/', 'c2f5f11b-45c5-4c15-9b04-a8aedb24a06f.mp4').then(resp4 => {
// USING THIS base64 RESPONSE DOESNT WORK EITHER
})
})
})
})
我有同样的问题,您设法解决了吗?