-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebcamera.html
More file actions
executable file
·47 lines (42 loc) · 1.26 KB
/
webcamera.html
File metadata and controls
executable file
·47 lines (42 loc) · 1.26 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Video Frames</title>
<link rel="stylesheet" href="style.css">
<style>
#movieclip {
display: none;
}
</style>
</head>
<body>
<header>Avoid cross domain security error. $ http-server -p 8000 -c-1 </header>
<canvas id="canvas"></canvas>
<video id="movieclip" autoplay>
<source src="./assets/movieclip.mp4" type="video/mp4"/>
<source src="./assets/movieclip.webm" type="video/webm"/>
<source src="./assets/movieclip.ogv" type="video/ogg"/>
</video>
<script src="utils.js"></script>
<script src="Stats.js"></script>
<script src="camera.js"></script>
<script>
window.onload = function () {
var canvas = document.getElementById('canvas'),
context = canvas.getContext('2d'),
video = document.getElementById('movieclip'),
stats = Stat.initStats();
Camera.createPlayButton(video);
(function drawFrame () {
stats.begin();
window.requestAnimationFrame(drawFrame, canvas);
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
context.drawImage(video, 0, 0);
stats.end();
}());
};
</script>
</body>
</html>