From bb8fa33493e4c6545b08eb12125076470f17c21a Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sat, 12 Aug 2023 23:09:46 -0700 Subject: [PATCH] Some fixes --- web/static/js/BareRTC.js | 22 +++++++++++++++++++++- web/templates/chat.html | 13 ++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/web/static/js/BareRTC.js b/web/static/js/BareRTC.js index 7be37d2..4f1d585 100644 --- a/web/static/js/BareRTC.js +++ b/web/static/js/BareRTC.js @@ -1689,7 +1689,27 @@ const app = Vue.createApp({ return false; }, - // Boot someone off yourn video. + // Show who watches our video. + showViewers() { + // TODO: for now, ChatClient is our bro. + let users = Object.keys(this.webcam.watching); + if (users.length === 0) { + this.ChatClient("There is currently nobody viewing your camera."); + } else { + this.ChatClient("Your current webcam viewers are:

" + users.join(", ")); + } + + // Also focus the Watching list. + this.whoTab = 'watching'; + + // TODO: if mobile, show the panel - this width matches + // the media query in chat.css + if (screen.width < 1024) { + this.openWhoPanel(); + } + }, + + // Boot someone off your video. bootUser(username) { if (!window.confirm( `Kick ${username} off your camera? This will also prevent them `+ diff --git a/web/templates/chat.html b/web/templates/chat.html index 8d1c7fc..a9169d9 100644 --- a/web/templates/chat.html +++ b/web/templates/chat.html @@ -592,6 +592,15 @@ Unmute + + +