-
Notifications
You must be signed in to change notification settings - Fork 1
/
main_feed.html
85 lines (67 loc) · 1.72 KB
/
main_feed.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
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Display Webcam Stream</title>
<style>
div:before {
position: absolute;
content:"";
height: 100vw;
width: 20px;
/* border-radius: 100%; */
border-spacing: 50vh;
top: 0;
left: 50vw;
z-index: 1;
background-color: rgb(255, 0, 0);
}
video {
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
/* clip: rect(600px, 300px, 0, 0); */
}
/*
.container{
left: 50vw;
width: 1000px;
overflow:hidden;
display:block;
height: 1000px;
} */
</style>
</head>
<body>
<!-- <canvas id="videoElement" width="300" height="600">
</canvas> -->
<center>
<div id="container" width="1000" height="100" >
<video autoplay="true" width="1000" height="1000" id="videoElement">
</video>
</div>
</center>
<script>
</script>
</body>
</html>
<!--
<video autoplay="true" id="videoElement">
</video> -->
<script>
var video = document.querySelector("#videoElement");
const constraints = {
audio: false,
video: {
width: 700, height: 1200
}
};
if (navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia(constraints, { video: true})
.then(function (stream) {
video.srcObject = stream;
})
.catch(function (err0r) {
console.log("Something went wrong!");
});
}
</script>