-
Notifications
You must be signed in to change notification settings - Fork 12
/
camera.php
289 lines (220 loc) · 7.17 KB
/
camera.php
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<!DOCTYPE html>
<!-- saved from url=(0042)http://www.webhek.com/demo/browser-camera/ -->
<html lang="zh-CN"><!--<![endif]--><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>RealSense</title>
<?php
session_start();
$camera=false;
if(isset($_SESSION['username'])){
header("Location: member.php");
}
?>
<style type="text/css">
img.wp-smiley,
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 .07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
</style>
<?php
if(!$camera){
header("Location: login.php");
}
include 'templete\header.html';
?>
<style>video { border: 1px solid #ccc; display: block; margin: 0 0 20px 0; }
#canvas { margin-top: 20px; border: 1px solid #ccc; display: block; }</style>
<!-- Clean Archives Reloaded v3.2.0 | http://www.viper007bond.com/wordpress-plugins/clean-archives-reloaded/ -->
<body class="single single-demo postid-850 masthead-fixed full-width footer-widgets singular whole-width">
<div id="page" class="hfeed site">
<div id="main" class="site-main">
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<article id="post-850" class="post-850 demo type-demo status-publish hentry">
<header class="entry-header">
<div class="fl wfs bcf7" style="padding-bottom:20px;">
<center>
<div class="alert alert-warning">
<a href="#" class="close" data-dismiss="alert">
×
</a>
<h1><font color='red'>请做出"V"字手势</font></h1>
</div>
</center>
</header><!-- .entry-header -->
<div class="entry-content">
<div class="single-content">
<div class="m20">
<!--
Ideally these elements aren't created until it's confirmed that the
client supports video/camera, but for the sake of illustrating the
elements involved, they are created with markup (not JavaScript)
-->
<center>
<video id="video" width="640" height="480" autoplay="" src="blob:http%3A//www.webhek.com/d80e4529-acb3-4a3c-ba52-ee55f88a1839"></video>
<button id="snap" class="sexyButton"> </button>
<canvas id="canvas" width="640" height="480"></canvas>
</center>
</div>
</div>
</section>
<div class="sidebar-content"><div id="content-sidebar" class="content-sidebar widget-area" role="complementary">
</div>
<div id="demo-frame">
<div id="demo-menu">
</div>
<div class="demo-frame-warp">
<div style="height:50px;"></div>
<iframe id="demo-iframe" frameborder="0" src="about:blank"></iframe>
</div>
</div>
<script type="text/javascript">
function show_demo(url){
jQuery('html, body').height('100%').css('overflow','hidden');
jQuery('#demo-frame').show();
jQuery('#demo-iframe').attr('src', url);
}
function close_demo(){
jQuery('html, body').height('auto').css('overflow','auto');
jQuery('#demo-frame').hide();
jQuery('#demo-iframe').attr('src', 'about:blank');
}
</script>
<script type="text/javascript">
jQuery(".best-img .lazy").lazyload();
jQuery("img.lazy").lazyload();
if( jQuery('pre').length > 0 ){
jQuery("<link/>", {
rel: "stylesheet",
type: "text/css",
href: "http://www.webhek.com/wordpress/wp-content/themes/webhek4/js/prism.css"
}).appendTo("head");
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = 'http://www.webhek.com/wordpress/wp-content/themes/webhek4/js/prism.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
}
</script>
<script type="text/javascript">
function t(app){
var summary = '';
var description;
var metas = document.getElementsByTagName('meta');
for (var x=0,y=metas.length; x<y; x++) {
if (metas[x].name.toLowerCase() == "description") {
description = metas[x];
}
}
if( description ) summary = description.content;
var title = document.title;
var url = document.location.href;
share_me(app, url, title, summary);
}
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-2477810-34', 'webhek.com');
ga('send', 'pageview');
</script>
<script type="text/javascript">
var shares_wb = 3;
var delay=5000;
setTimeout(function(){
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = 'http://www.webhek.com/wordpress/wp-content/themes/webhek4/js/wb.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
},delay);
</script>
<script type="text/javascript">
setTimeout(function(){
jQuery.getScript('http://static.webhek.com/misc/get-code.php?_='+(new Date()));
},5000);
</script>
<script>// Put event listeners into place
window.addEventListener("DOMContentLoaded", function() {
// Grab elements, create settings, etc.
var canvas = document.getElementById("canvas"),
context = canvas.getContext("2d"),
video = document.getElementById("video"),
videoObj = { "video": true },
errBack = function(error) {
console.log("Video capture error: ", error.code);
};
// Put video listeners into place
if(navigator.getUserMedia) { // Standard
navigator.getUserMedia(videoObj, function(stream) {
video.src = stream;
video.play();
}, errBack);
} else if(navigator.webkitGetUserMedia) { // WebKit-prefixed
navigator.webkitGetUserMedia(videoObj, function(stream){
video.src = window.webkitURL.createObjectURL(stream);
video.play();
}, errBack);
} else if(navigator.mozGetUserMedia) { // WebKit-prefixed
navigator.mozGetUserMedia(videoObj, function(stream){
video.src = window.URL.createObjectURL(stream);
video.play();
}, errBack);
}
// Trigger photo take
document.getElementById("snap").addEventListener("click", function() {
context.drawImage(video, 0, 0, 640, 480);
});
}, false);
</script>
<script>
function closewin()
{
//alert(init);
if(init>12){
alert('验证失败!');
var url = './camera.php';
open(url, '_self');
}
else{
alert('验证成功!');
var url = './login.php';
open(url, '_self');
}
}
function clock()
{
i=i-1
// document.title='it will close in '+i+' seconds';
if(i>0)setTimeout("clock();",1000);
else closewin();
}
// srand(time(null));
var i,init;
if (window.MessageEvent && !document.getBoxObjectFor){
i = Math.floor(3+Math.random()*15);
init = i;
//i = 111111;
// alert(init);
}
else{
i = 11111;
}
// alert(i)
clock();
</script>
<span id="pageendflag"></span>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/
Page Caching using disk: enhanced
Served from: www.webhek.com @ 2015-11-18 10:33:43 by W3 Total Cache --></body></html>