Update static/index.html
Browse files- static/index.html +9 -1
static/index.html
CHANGED
@@ -56,7 +56,13 @@
|
|
56 |
|
57 |
// Initialize WebSocket connection
|
58 |
socket = new WebSocket(`wss://${window.location.host}/ws`);
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
socket.onmessage = (event) => {
|
61 |
const data = JSON.parse(event.data);
|
62 |
|
@@ -117,6 +123,8 @@
|
|
117 |
|
118 |
// Initialize when page loads
|
119 |
window.addEventListener('load', initializeAudio);
|
|
|
|
|
120 |
</script>
|
121 |
</body>
|
122 |
</html>
|
|
|
56 |
|
57 |
// Initialize WebSocket connection
|
58 |
socket = new WebSocket(`wss://${window.location.host}/ws`);
|
59 |
+
|
60 |
+
|
61 |
+
socket.onclose = () => {
|
62 |
+
document.getElementById('status').textContent = 'Reconnecting...';
|
63 |
+
setTimeout(initializeAudio, 1000); // Attempt reconnection
|
64 |
+
};
|
65 |
+
|
66 |
socket.onmessage = (event) => {
|
67 |
const data = JSON.parse(event.data);
|
68 |
|
|
|
123 |
|
124 |
// Initialize when page loads
|
125 |
window.addEventListener('load', initializeAudio);
|
126 |
+
|
127 |
+
|
128 |
</script>
|
129 |
</body>
|
130 |
</html>
|