-
Notifications
You must be signed in to change notification settings - Fork 0
/
artcam.html
76 lines (69 loc) · 2.29 KB
/
artcam.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title></title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
overflow: hidden;
}
#DocCam {
position: absolute;
top: 0;
left: 0;
/* transform: rotate(90deg) scale(1.35); */
filter: contrast(1.3); /* brightness(1.1) saturate(0.8); */
width: 100%;
}
#FaceCam {
position: absolute;
z-index: 10;
bottom: 9vh;
left: 3vw;
height: 19vh;
border: 4px solid black;
}
#PiperMake {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: calc(72vw + 1px);
border: none;
}
</style>
</head>
<body>
<video id="DocCam"></video>
<!--<video id="FaceCam"></video>-->
<script>
function openCam(camID, target) {
navigator.mediaDevices.getUserMedia({
video: {deviceId: {
exact: camID,
},}
}).then(function (vidStream) {
let video = document.getElementById(target);
video.srcObject = vidStream;
video.onloadedmetadata = function (e) { video.play(); };
}).catch(function (e) {
console.log(e.name + ": " + e.message);
});
}
async function startCams() {
const camList = await navigator.mediaDevices.enumerateDevices();
camList.forEach((d) => {
if (d.label.indexOf('IPEVO') > -1) {
openCam(d.deviceId, 'DocCam');
} else if (d.label.indexOf('FaceTime HD') > -1) {
//openCam(d.deviceId, 'FaceCam');
}
});
}
startCams();
</script>
</body>
</html>