创建多个 wx.createVideoDecoder()同时解码多个视频,解码结束后视频帧数据不对?
videoDecoder: async function (localFile,id) {
const canvas = wx.createOffscreenCanvas({
type: '2d',
width: this.data.canvasWidth,
height:this.data.canvasHeight
})
let decoder = wx.createVideoDecoder();
await decoder.start({
abortAudio: true,
source: localFile
})
//监听解码结束
this.ended = false;
const _this = this
decoder.on('ended', () => {
_this.ended = true;
})
//监听seek事件
decoder.on('seek', () => {
console.log('开始解码',new Date())
_this.frameImage(decoder, canvas,id);
})
decoder.seek(0)
},
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。