From 4ee6c106d216852714952707ade04a163c13c4f0 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Fri, 11 Aug 2023 18:42:06 -0700 Subject: [PATCH] Add live camera settings to the chat settings modal --- web/static/js/BareRTC.js | 23 ++++++++++- web/templates/chat.html | 88 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 109 insertions(+), 2 deletions(-) diff --git a/web/static/js/BareRTC.js b/web/static/js/BareRTC.js index 1d9b05a..41818b0 100644 --- a/web/static/js/BareRTC.js +++ b/web/static/js/BareRTC.js @@ -312,7 +312,24 @@ const app = Vue.createApp({ status() { // Send presence updates to the server. this.sendMe(); - } + }, + + // Webcam preferences that the user can edit while live. + "webcam.nsfw": function() { + if (this.webcam.active) { + this.sendMe(); + } + }, + "webcam.mutual": function() { + if (this.webcam.active) { + this.sendMe(); + } + }, + "webcam.mutualOpen": function() { + if (this.webcam.active) { + this.sendMe(); + } + }, }, computed: { chatHistory() { @@ -630,6 +647,10 @@ const app = Vue.createApp({ } } + // Hang up on mutual cameras, if they changed their setting while we + // are already watching them. + this.unMutualVideo(); + // Has the back-end server forgotten we are on video? This can // happen if we disconnect/reconnect while we were streaming. if (this.webcam.active && !(this.whoMap[this.username]?.video & this.VideoFlag.Active)) { diff --git a/web/templates/chat.html b/web/templates/chat.html index f60ecbd..d53dd7e 100644 --- a/web/templates/chat.html +++ b/web/templates/chat.html @@ -82,7 +82,12 @@
  • - Sound effects + Sounds + +
  • +
  • + + Camera
  • @@ -247,6 +252,87 @@ + +
    +

    + Camera Settings +

    + +

    + The settings on this tab will be relevant only when you are already + broadcasting your camera. They allow you to modify your broadcast settings + while you are already live (for example, to change your mutual camera + preference or select another audio/video device to broadcast from). +

    + +

    + +

    +
    + +
    + +

    + +

    + +
    + +
    + +
    + +
    + +

    + Webcam Devices +

    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    +
    +