1.已經在pc上實現了在canvas中播放video標簽的視頻,現在在手機上進行測試,發現無法播放了2.` var fps = 1000/30; // 1/30秒var videoObj = document.getElementById("sec4-video");var canvasObj = document.getElementById("sec4-canvas");
var ctx=canvasObj.getContext('2d');
videoObj.addEventListener('play', function() { var i=window.setInterval(function() {
ctx.drawImage(videoObj,0,0,400,400);},fps);
},true);`<div class="slide-wrap"> <video autoplay loop id="sec4-video">
<source src="video/world-home-flat.mp4" type="video/mp4">
</video>
<canvas id="sec4-canvas" width="400" height="400"></canvas>
</div>
關于移動端在canvas中播放視頻
慕無忌1623718
2018-09-07 10:10:39