目前现象
文件是从网络地址download的m3u8文件, ts分片已经使用了绝对地址, 保存到本地临时文件, wxfile://tmp_xxxx.m3u8
在调试器中是可以播放的(调试器会把地址转换为网络地址), ios真机无法播放本地临时文件.
类似反馈
https://developers.weixin.qq.com/community/develop/doc/9f1f99e891a052f291cef519a0208ba1
文档中是明确说明了支持本地临时路径的
https://developers.weixin.qq.com/miniprogram/dev/component/video.html
"要播放视频的资源地址,支持网络路径、本地临时路径、云文件ID(2.3.0)"
你好,麻烦提供下视频地址
<view class="page-body">
<view class="page-section tc">
<video
id="myVideo"
src="{{src}}"
binderror="videoErrorCallback"
controls
></video>
</view>
</view>
let src = 'https://dingyue.ws.126.net/test2.m3u8';
Page({
data: {
src
},
onReady: function (res) {
this.videoContext = wx.createVideoContext('myVideo')
let that = this
wx.downloadFile({
url: src,
success(res) {
const fs = wx.getFileSystemManager()
let content = fs.readFileSync(res.tempFilePath, 'utf8', 0)
that.setData({
src: res.tempFilePath
})
},
})
},
videoErrorCallback: function (e) {
console.log('视频错误信息:')
console.log(e.detail.errMsg)
}
})
您好,您解决了吗?我也遇到了同样的问题