From db30b052f9a20dd8dd82cf1a2593d73d79a770f4 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Fri, 16 Sep 2022 18:53:02 +0200 Subject: [PATCH] Include camera indicator in users list. --- static/galene.css | 16 ++++++++++++++++ static/galene.js | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/static/galene.css b/static/galene.css index 266409e..ba91d35 100644 --- a/static/galene.css +++ b/static/galene.css @@ -1156,6 +1156,22 @@ header .collapse:hover { content: "\f256"; } +#users > div::after { + font-family: 'Font Awesome 6 Free'; + color: #808080; + margin-left: 5px; + font-weight: 900; + float: right; +} + +#users > div.user-status-microphone::after { + content: "\f130"; +} + +#users > div.user-status-camera::after { + content: "\f030"; +} + .close-icon { font: normal 1em/1 Arial, sans-serif; display: inline-block; diff --git a/static/galene.js b/static/galene.js index 1852d47..4514a44 100644 --- a/static/galene.js +++ b/static/galene.js @@ -2172,6 +2172,26 @@ function setUserStatus(id, elt, userinfo) { elt.classList.add('user-status-raisehand'); else elt.classList.remove('user-status-raisehand'); + + let microphone=false, camera = false; + for(let label in userinfo.streams) { + for(let kind in userinfo.streams[label]) { + if(kind == 'audio') + microphone = true; + else + camera = true; + } + } + if(camera) { + elt.classList.remove('user-status-microphone'); + elt.classList.add('user-status-camera'); + } else if(microphone) { + elt.classList.add('user-status-microphone'); + elt.classList.remove('user-status-camera'); + } else { + elt.classList.remove('user-status-microphone'); + elt.classList.remove('user-status-camera'); + } } /**