android里canvas视频帧,移动端用canvas截取视频封面,如何不截取第一帧,而是截取其它的帧?...
我在微信開發(fā)工具里截的圖是可以的,但是在手機(jī)上截的圖缺變成全透明的了。
我猜是視頻的第一幀的問(wèn)題
微信開發(fā)工具的截圖
手機(jī)的截圖
我的代碼:
JS:
function captureImage(video) {
var scale=1
var canvas = document.createElement("canvas");
var vw=$(video).width()
var vh=$(video).height()
console.log(vw,vh)
canvas.width = vw* scale;
canvas.height = vh* scale;
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);
var img = document.createElement("img");
img.className='poster'
img.src = canvas.toDataURL("image/png");
$(video).prop('poster',canvas.toDataURL("image/png"))
};
HTML標(biāo)簽:
總結(jié)
以上是生活随笔為你收集整理的android里canvas视频帧,移动端用canvas截取视频封面,如何不截取第一帧,而是截取其它的帧?...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: mysql 删除另一个表中的_mysql
- 下一篇: 通过代理上网 固定ip_浅析局部代理IP