From 74c7b2dbb4a11e3ab054a519cf02255e6a8944ce Mon Sep 17 00:00:00 2001 From: Mathieu Strypsteen Date: Fri, 27 Oct 2023 15:40:01 +0200 Subject: [PATCH] Add warning on camera feed disconnect --- content/assets/scripts/cammie.js | 11 +++++++++++ content/cammie.erb | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/content/assets/scripts/cammie.js b/content/assets/scripts/cammie.js index d8442fe5..d209cdb4 100644 --- a/content/assets/scripts/cammie.js +++ b/content/assets/scripts/cammie.js @@ -26,6 +26,17 @@ debounce = function(func, wait, initial) { function cammie_error() { $("#cammie-feed").attr("src","/assets/images/cammie_down.svg") } +var cammieTimerStarted = false; +function cammie_loaded() { + if (cammieTimerStarted) { + return; + } + showWarning = function() { + document.getElementById("cammieFeedDisconnected").classList.remove("is-hidden"); + }; + setTimeout(showWarning, 25000); + cammieTimerStarted = true; +} $("#cammie-ctrls").mousemove(debounce(function() { return $(this).removeClass('display'); diff --git a/content/cammie.erb b/content/cammie.erb index b75898a5..78ea5f84 100644 --- a/content/cammie.erb +++ b/content/cammie.erb @@ -16,9 +16,14 @@ socket.on('replymessage', function(obj) { <% end %>
+
- cammie + cammie