-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
47 lines (41 loc) · 1.15 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>Video Server</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function () {
var webSocket = new WebSocket("ws://" + window.location.host + window.location.pathname + "ws");
webSocket.onopen = function () {
webSocket.send(1);
};
webSocket.onmessage = function (msg) {
<!-- $("#video").attr("src", "data:image/jpg;base64," + msg.data); -->
msg = msg.data.split(",");
var image = msg[0];
var image_class = msg[1];
var image_score = msg[2];
$("#video").attr("src", "data:image/jpg;base64," + image);
$("#image_class").text(image_class);
$("#image_score").text(image_score);
webSocket.send(1);
};
webSocket.onerror = function (e) {
console.log(e);
webSocket.send(1);
};
});
</script>
<style>
body {
font-family: "メイリオ";
}
</style>
</head>
<body>
<h1>Neko Camera</h1>
<img id="video" src="" />
<p id="image_class"></p>
<p id="image_score"></p>
</body>
</html>