You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1006 B

<!doctype html>
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function() {
$('#do').click(function() {
var code = $('#testCode').val();
eval(code);
});
});
</script>
<style type="text/css">
#testCode {
width: 500px;
height: 300px;
font-size: 20px;
}
#video1 {
width: 320px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="preview">
<video id="video1" class="testvideo" src="test1.ogg" controls="controls"></video>
<canvas id="canvas" width="320" height="240"></canvas>
</div>
<div id="txtWrap">
<textarea id="testCode">
var canvas = document.querySelector("canvas");
var ctx = canvas.getContext("2d");
var video = document.getElementById("video1");
ctx.drawImage(video, 0, 0, video.width, video.height, 0, 0, canvas.width, canvas.height);
</textarea><br />
<button id="do">Do</button>
</div>
</div>
</body>
</html>