Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +13 -45
templates/index.html
CHANGED
@@ -1,50 +1,18 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
-
|
5 |
-
|
6 |
-
<
|
7 |
-
<
|
8 |
-
|
9 |
-
|
10 |
-
<h2 class="border-b border-gray-800 py-4 mb-4 text-3xl font-bold leading-none tracking-tight md:text-4xl lg:text-4xl text-gray-500">التحكم</h2>
|
11 |
-
<div class="border-b border-gray-800" style="padding: 10px;">
|
12 |
-
<button class="text-white focus:ring-4 focus:outline-none mt-1.5 font-medium rounded-lg text-sm w-full py-2.5 text-center bg-gray-700 hover:bg-gray-800 focus:ring-gray-900" id="start-camera" type="button" onclick="startCamera()">بدء الكاميرا</button>
|
13 |
-
<button class="text-white focus:ring-4 focus:outline-none mt-1.5 font-medium rounded-lg text-sm w-full py-2.5 text-center bg-gray-700 hover:bg-gray-800 focus:ring-gray-900" id="stop-camera" type="button" onclick="stopCamera()">إيقاف الكاميرا</button>
|
14 |
-
</div>
|
15 |
-
</div>
|
16 |
-
|
17 |
-
<!-- Video section -->
|
18 |
-
<div class="col-span-8 mx-4 mt-3" style="background-color: lightgrey; border-radius: 10px;">
|
19 |
-
<div id="container">
|
20 |
-
<img class="center" src="" id="video_feed"> <!-- Updated to have an empty source -->
|
21 |
-
</div>
|
22 |
-
</div>
|
23 |
-
|
24 |
-
<!-- Terminal section -->
|
25 |
-
<div class="col-span-2 mr-4" style="background-color: lightgrey; border-radius: 10px;">
|
26 |
-
<h2 class="border-b border-gray-800 py-4 mb-4 text-3xl flex justify-end font-bold leading-none tracking-tight md:text-4xl lg:text-4xl text-gray-500">الناتج</h2>
|
27 |
-
<div id="terminal" class="w-full"></div>
|
28 |
-
</div>
|
29 |
-
</div>
|
30 |
-
|
31 |
-
<div>
|
32 |
-
<p id="finalSentencePara" class="text-gray-500 mt-4 text-center"></p>
|
33 |
-
</div>
|
34 |
-
|
35 |
-
<!-- Inline JavaScript -->
|
36 |
-
<script>
|
37 |
-
function startCamera() {
|
38 |
-
fetch('/capture_frame') // Send a request to the Flask app route
|
39 |
-
.then(response => response.text())
|
40 |
-
.then(data => {
|
41 |
-
document.getElementById("video_feed").src = 'data:image/jpeg;base64,' + data; // Display the processed frame
|
42 |
-
});
|
43 |
-
}
|
44 |
-
|
45 |
-
function stopCamera() {
|
46 |
-
// Add logic to stop the camera feed
|
47 |
}
|
48 |
-
</
|
|
|
|
|
|
|
|
|
|
|
49 |
</body>
|
50 |
-
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>LIVE STREAMING</title>
|
7 |
+
<style>
|
8 |
+
a {
|
9 |
+
font-size: 30px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
}
|
11 |
+
</style>
|
12 |
+
</head>
|
13 |
+
<body>
|
14 |
+
<video id="remoteVideo" autoplay></video>
|
15 |
+
<a href="{{ url_for('video_feed') }}" target="_self">Link to Video Feed</a>
|
16 |
+
<script src="{{ url_for('static', filename='main.js') }}"></script>
|
17 |
</body>
|
18 |
+
</html>
|