-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcamera_index.h
66 lines (59 loc) · 1.81 KB
/
camera_index.h
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
#ifndef CAM_IND_H
#define CAM_IND_H
//see https://github.com/limengdu/SeeedStudio-XIAO-ESP32S3-Sense-camera/tree/main/CameraWebServer_for_esp-arduino_3.0.x
static const char INDEX_HTML[] = R"rawliteral(
<html>
<head>
<title>ESP32-CAM Video Stream</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body { font-family: Arial; text-align: center; margin:0px auto; padding-top: 30px;}
table { margin-left: auto; margin-right: auto; }
td { padding: 8 px; }
.button {
background-color: #2f4468;
border: none;
color: white;
padding: 20px 40px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 20px;
margin: 6px 3px;
cursor: pointer;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
img { width: auto ;
max-width: 100% ;
height: auto ;
}
</style>
</head>
<body>
<h1>ESP32-CAM Video Stream</h1>
<img src="" id="photo" >
<div align="center">
<button class="button" onclick="startStream('start');">START</button>
<button class="button" onclick="startStream('stop');">STOP</button>
</div>
<script>
function startStream(x) {
if(x=='start'){
document.getElementById("photo").src = window.location.href.slice(0, -1) + ":81/stream";
}
else if(x=='stop'){
document.getElementById("photo").src = "";
}
}
window.onload = document.getElementById("photo").src = window.location.href.slice(0, -1) + ":81/stream";
</script>
</body>
</html>
)rawliteral";
#endif