场景:在本地选择视频,想要获得视频每帧数据,通过getFrameData()调用时返回null
机型:OPPO A11X
代码:
wx.chooseVideo({
sourceType: ['album'],
success(res) {
let path = res.tempFilePath;
let video = wx.createVideoDecoder()
console.log(video)
video.on('start', (v) => {
video.seek(0);
console.log("frameData1", video.getFrameData())
})
video.on('seek', (e) => {
console.log("seek===========", e.position);
console.log("frameData", video.getFrameData())
})
video.on('stop', () => console.log(2))
video.start({source: path, mode: 0})
setTimeout(() => video.seek(1), 1000);
setTimeout(() => video.seek(2), 1000);
setTimeout(() => video.seek(3), 1000);
}
})
同样问题
遇到同样问题,有解吗?