From 45ab63cfbaa36390f575f2993ff6418ad3342877 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Fri, 31 Mar 2023 20:25:53 -0700 Subject: [PATCH] Remember video mutality prefs on localStorage --- web/static/js/BareRTC.js | 12 ++++++++++++ web/templates/chat.html | 3 +-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/web/static/js/BareRTC.js b/web/static/js/BareRTC.js index 97f7777..a0c00c1 100644 --- a/web/static/js/BareRTC.js +++ b/web/static/js/BareRTC.js @@ -292,6 +292,14 @@ const app = Vue.createApp({ if (localStorage.fontSizeClass != undefined) { this.fontSizeClass = localStorage.fontSizeClass; } + + // Webcam mutality preferences from last broadcast. + if (localStorage.videoMutual === "true") { + this.webcam.mutual = true; + } + if (localStorage.videoMutualOpen === "true") { + this.webcam.mutualOpen = true; + } }, signIn() { @@ -932,6 +940,10 @@ const app = Vue.createApp({ this.webcam.elem.srcObject = stream; this.webcam.stream = stream; + // Save our mutuality prefs. + localStorage.videoMutual = this.webcam.mutual; + localStorage.videoMutualOpen = this.webcam.mutualOpen; + // Tell backend the camera is ready. this.sendMe(); }).catch(err => { diff --git a/web/templates/chat.html b/web/templates/chat.html index a568fee..6e6be80 100644 --- a/web/templates/chat.html +++ b/web/templates/chat.html @@ -256,7 +256,6 @@
@@ -387,7 +386,7 @@ 'is-danger': webcam.nsfw}" @click.prevent="webcam.nsfw = !webcam.nsfw; sendMe()" title="Toggle the NSFW setting for your camera broadcast"> - + Explicit