一般情况下我看网页上的视频能不能作为3D模型的纹理,就会在canvas上先看一下能不能把视频中的每一帧给取出来。
下面这段代码的是将一个网页上的视频(<video>标签)画个一个canvas的HTML5的代码。
<!DOCTYPE html>
<html>
<head>
<title>Android video play</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {margin:0; overflow:hidden;} /* use the complete page */
</style>
</head>
<body>
<p>This is a demo about video play</p>
<video id="video" autoplay = "true" loop = "true" width="200" height="200" src="../videoSrc/ogg-19M.ogg" crossorigin=" "></video>
<canvas id = 'canvas' wid