在这里插入代码片<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
height: 1000px;
}
#c1{
position: fixed;
right: 0;
bottom: 0;
}
</style>
</head>
<body>
<canvas id="c1" ></canvas>
<video src="./Intermission-Walk-in_512kb.mp4" controls></video>
<script>
var oC = document.getElementById("c1");
var oVid = document.getElementsByTagName("video")[0];
var oCG = oC.getContext("2d");
window.onload = function (){
oC.width = oVid.offsetWidth/2;
oC.height = oVid.offsetHeight/2;
setInterval(function (){
oCG.drawImage(oVid,0,0,oC.width,oC.height);
},16.67)
}
</script>
</body>
</html>
canvas-绘制视频
最新推荐文章于 2024-04-05 14:24:04 发布