aboutsummaryrefslogtreecommitdiffstats
path: root/static/modules/obs.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/modules/obs.js')
-rw-r--r--static/modules/obs.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/static/modules/obs.js b/static/modules/obs.js
index 3cc4197..5005ffc 100644
--- a/static/modules/obs.js
+++ b/static/modules/obs.js
@@ -17,6 +17,8 @@
// OBS as a stream-deck tab: icon-forward buttons and volume sliders, sized
// for a finger rather than a mouse.
+import { offline } from "../offline.js";
+
const ICONS = {
record: '<circle cx="12" cy="12" r="7"/>',
stream: '<path d="M2 8.8a15 15 0 0 1 20 0"/><path d="M5 12.5a10 10 0 0 1 14 0"/><path d="M8.5 16.2a5 5 0 0 1 7 0"/><circle cx="12" cy="20" r="1"/>',
@@ -154,11 +156,16 @@ export default {
update(state, el) {
const transport = el.querySelector(".deck-transport");
+ // Off, the empty Scenes/Audio/Sources/Transition blocks would only be
+ // headings, so they go and the card says what brings OBS back.
+ for (const cols of el.querySelectorAll(".deck-cols")) cols.hidden = !state.connected;
if (!state.connected) {
- transport.innerHTML = `<div class="deck-offline">${state.error ? `OBS offline: ${state.error}` : "OBS offline"}</div>`;
- for (const box of el.querySelectorAll(".scenes, .sources, .mixer, .transitions")) {
- box.textContent = "";
- }
+ offline(transport, {
+ icon: "/icons/com.obsproject.Studio.svg",
+ title: "OBS is not running",
+ detail: "Start OBS and its scenes, sources and audio appear here.",
+ reason: state.error,
+ });
return;
}
renderTransport(transport, state);