苹果手机使用video播放视频流会自动全屏播放视频
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| var video = document.getElementById("videoElement"); var FrameRates = { film: 24, NTSC : 29.97, NTSC_Film: 23.98, NTSC_HD : 59.94, PAL: 25, PAL_HD: 50, web: 30, high: 60 }; debug = true; setTimeout(() => { video.src = "./1.mp4"; video.play();
let canvas = document.createElement("canvas"); let context = canvas.getContext("2d"); canvas.width = w; canvas.height = h; context.drawImage(video, 0, 0,w, h); }, 500);
|
requestAnimationFrame.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
if ( !window.requestAnimationFrame ) { window.requestAnimationFrame = ( function() { return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function( callback, element ) { return window.setTimeout( callback, 1000 / 60 ); }; } )(); } if ( !window.cancelRequestAnimationFrame ) { window.cancelRequestAnimationFrame = ( function() { return window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout } )(); }
|