aboutsummaryrefslogtreecommitdiff
path: root/templates/main.html.bak
diff options
context:
space:
mode:
authorFranoosh <uinarf@autistici.org>2025-07-25 17:13:38 +0200
committerFranoosh <uinarf@autistici.org>2025-10-15 14:33:59 +0200
commit68bd1bd052a7cd6438b92cb1059ef5e58b8d022c (patch)
tree5a7eab3022a7593bd3d9dbdcc99a1590ab0fc3bc /templates/main.html.bak
downloadZeroMQ_Video_Streaming-68bd1bd052a7cd6438b92cb1059ef5e58b8d022c.tar.gz
ZeroMQ_Video_Streaming-68bd1bd052a7cd6438b92cb1059ef5e58b8d022c.tar.bz2
ZeroMQ_Video_Streaming-68bd1bd052a7cd6438b92cb1059ef5e58b8d022c.zip
Initial commit. Proof of concept message passing between client <-> router <-> worker with rudimentary caching
Diffstat (limited to 'templates/main.html.bak')
-rw-r--r--templates/main.html.bak35
1 files changed, 35 insertions, 0 deletions
diff --git a/templates/main.html.bak b/templates/main.html.bak
new file mode 100644
index 0000000..7bb2ee5
--- /dev/null
+++ b/templates/main.html.bak
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Live Streaming</title>
+ </head>
+ <body>
+ <img id="frame" src="">
+ <h1>Streaming. Live.</h1>
+ <script>
+ let ws = new WebSocket("ws://127.0.0.1:8880/{{client_id}}/{{camera_id}}");
+ let image = document.getElementById("frame");
+ let currentUrl = null;
+
+ ws.onmessage = function(event) {
+ if (currentUrl) {
+ URL.revokeObjectURL(currentUrl);
+ }
+ currentUrl = URL.createObjectURL(event.data);
+ image.src = currentUrl;
+ };
+
+ ws.onclose = function(event) {
+ console.log("WebSocket closed:", event);
+ };
+
+ ws.onerror = function(event) {
+ console.log("WebSocket error:", event);
+ };
+
+ window.addEventListener('beforeunload', function() {
+ ws.close();
+ });
+ </script>
+ </body>
+</html>