-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebsocket-chat.html
More file actions
40 lines (38 loc) · 2 KB
/
websocket-chat.html
File metadata and controls
40 lines (38 loc) · 2 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Websocket - Gemini LiveAPI Chat</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous" />
<link rel="stylesheet" href="assets/css/common.css" />
</head>
<body class="p-4">
<h1 class="fs-4 text-center">Using websocket client side with gemini live API</h1>
<div class="d-flex justify-content-center my-5 gap-4">
<div class="aiResponseArea border p-3" id="aiResponseArea"></div>
<div class="userArea border p-3">
<!-- video media stream -->
<video id="userVideo" autoplay muted class="w-100 mb-3 border"></video>
<div class="d-flex gap-2">
<button id="startRecording" class="btn btn-primary flex-fill">Start Recording</button>
<button id="stopRecording" class="btn btn-danger flex-fill" disabled>Stop Recording</button>
</div>
<div class="mt-3">
<strong>Your Transcript:</strong>
<div id="userTranscript"></div>
</div>
</div>
</div>
<!-- Loader -->
<div id="loadingOverlay" style="display: none" class="position-fixed top-0 start-0 w-100 h-100 align-items-center justify-content-center bg-black text-white bg-opacity-75">
<div class="text-center">
<div class="spinner-border text-primary mb-2" role="status">
<span class="visually-hidden"><?= __('loading', 'Loading...') ?></span>
</div>
<div><?= __('processing', 'Loading...') ?></div>
</div>
</div>
<script type="module" src="assets/js/main.js"></script>
</body>
</html>