-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCam.html
45 lines (41 loc) · 1.15 KB
/
Cam.html
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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="Webcam.js"></script>
<script>
$(document).ready(function () {
Webcam.set({
width: 320,
height: 240,
image_format: 'jpeg',
jpeg_quality: 90
});
Webcam.attach('#webcam');
$("#btnCapture").click(function () {
Webcam.snap(function (data_uri) {
$(".imgList").append('<img src="' + data_uri + '"/>');
});
});
$("#btnStart").click(function () {
Webcam.start("preview");
});
$("#btnStop").click(function () {
Webcam.stop();
});
});
</script>
<html>
<div>
<div id="webcam"></div>
<br>
<input type="button" id="btnCapture" class="btn btn-info" value="Capture" />
<input type="button" id="btnStart" class="btn btn-info" value="Start" />
<input type="button" id="btnStop" class="btn btn-info" value="Stop" />
</div>
<div>
<h1>Video Player</h1>
<video id="preview" width="240" height="180" autoplay controls></video>
</div>
<div>
<h1>Images</h1>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 imgList"></div>
</div>
</html>