<template v-if="!detectvideo">
<view class="uni-hello-addfile" >{{textinfo}}</view>
</template>
<template v-else>
<video v-show="detectvideo" :src="detectvideo" class="video" crossOrigin="anonymous"></video>
</template>
uni.downloadFile({
url: 'http://192.168.1.106:5000/download_mp4',
success: (res) => {
if (res.statusCode === 200) {
$vm.detectvideo=res.tempFilePath;
}
}
将下载后的文件路径写入video的src后会出现播放不了的问题,用手机端测试是可以看到文件下载成功了的
1***@qq.com (作者)
直接写路径好像也不行,但是找到文件是可以播放的
2020-04-14 12:22
DCloud_uniCloud_WYQ
打印出来的res.tempFilePath是什么
2020-04-14 13:48
DCloud_uniCloud_WYQ
你把完整的页面代码贴一下吧
2020-04-14 13:48
1***@qq.com (作者)
回复 DCloud_uniCloud_WYQ: 找到原因了,是视频编码格式的问题,video不支持一些编码格式的视频,改了之后就好了,谢谢了
2020-04-14 14:42