首页 > 关于移动端在canvas中播放视频

关于移动端在canvas中播放视频

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>
【热门文章】
【热门文章】