From 302a77b5d9f924873e4836703375a7b3ae664aa5 Mon Sep 17 00:00:00 2001 From: Ed Jordan Date: Mon, 4 Nov 2024 17:04:06 -0800 Subject: [PATCH] Video Switcher (#204) * Video Switcher Added audience display switcher to the lower thirds page. also added button to show a lower third and switch to blank * Update setup_lower_thirds.go --- static/js/lower_thirds.js | 21 +++++++++- templates/setup_lower_thirds.html | 64 +++++++++++++++++++++++++++++++ web/setup_lower_thirds.go | 12 ++++++ 3 files changed, 96 insertions(+), 1 deletion(-) diff --git a/static/js/lower_thirds.js b/static/js/lower_thirds.js index 2f537dd4..27e06833 100644 --- a/static/js/lower_thirds.js +++ b/static/js/lower_thirds.js @@ -20,6 +20,13 @@ var showLowerThird = function(button) { websocket.send("showLowerThird", constructLowerThird(button)); }; +// Sends a websocket message to show the given lower third and clear the audence display. +var showLowerThirdOnly = function(button) { + websocket.send("showLowerThird", constructLowerThird(button)); + $("input[name=audienceDisplay][value=blank]").prop("checked", true); + setAudienceDisplay(); +}; + // Sends a websocket message to hide the lower third. var hideLowerThird = function(button) { websocket.send("hideLowerThird", constructLowerThird(button)); @@ -36,7 +43,19 @@ var constructLowerThird = function(button) { BottomText: button.form.bottomText.value } }; +// Handles a websocket message to update the audience display screen selector. +const handleAudienceDisplayMode = function(data) { + $("input[name=audienceDisplay]:checked").prop("checked", false); + $("input[name=audienceDisplay][value=" + data + "]").prop("checked", true); +}; + +// Sends a websocket message to change what the audience display is showing. +const setAudienceDisplay = function() { + websocket.send("setAudienceDisplay", $("input[name=audienceDisplay]:checked").val()); +}; $(function() { // Set up the websocket back to the server. - websocket = new CheesyWebsocket("/setup/lower_thirds/websocket", {}); + websocket = new CheesyWebsocket("/setup/lower_thirds/websocket", { + audienceDisplayMode: function(event) { handleAudienceDisplayMode(event.data); }, + }); }); diff --git a/templates/setup_lower_thirds.html b/templates/setup_lower_thirds.html index e97e3b72..fabd8708 100644 --- a/templates/setup_lower_thirds.html +++ b/templates/setup_lower_thirds.html @@ -7,6 +7,67 @@ {{define "title"}}Lower Thirds{{end}} {{define "body"}}
+
+
+ Audience Display +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
Lower Thirds @@ -30,6 +91,9 @@ +