💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
* 代码 ~~~ var video = $('#video_1').get(0); $('#canvas_1').on('click',function(){ if($(this).hasClass('play')){ // 状态播放时处理 $(this).removeClass('play'); video.pause(); }else{ // 状态暂停时处理 $(this).addClass('play'); video.play(); } }); var canvas = $('#canvas_1').get(0); var ctx = canvas.getContext('2d'); video.addEventListener('play', function() { var i = window.setInterval(function() {ctx.drawImage(video,0,0,canvas.width,canvas.height)},10); },false); video.addEventListener('pause',function() {window.clearInterval(i);},false); video.addEventListener('ended',function() {clearInterval(i);},false); ~~~