From b0adf8bc17c280f0e5e4b31478209c11d6cb5ccc Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Mon, 25 Apr 2022 13:09:31 +0200 Subject: [PATCH] stream.py: BBB_HIDE_MEETING_TITLE and BBB_HIDE_WHO_TALKS Flags to hide both the meeting's title as well as who is currently talking. Those are separate flags, as one might only want one of those, depending on the specific kind of meeting. --- README.md | 2 ++ stream.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 9c9a5c4..bd90781 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ You need to set some environment variables to run the container. * BBB_SHOW_CHAT - shows the chat on the left side of the window (Default: false) * BBB_RESOLUTION - the streamed/downloaded resolution (Default: 1920x1080) * BBB_CHAT_MESSAGE - prefix for the message that would be posted to BBB chat, while joining a conference (Default: "This meeting is streamed to") +* BBB_HIDE_MEETING_TITLE - hide the meeting title in the top bar (Default: false) +* BBB_HIDE_WHO_TALKS - hide the annotation who is currently talking (Default: false) * TZ - Timezone (Default: Europe/Vienna) #### Chat settings diff --git a/stream.py b/stream.py index 0ce6f7e..d700ad5 100644 --- a/stream.py +++ b/stream.py @@ -16,6 +16,7 @@ from selenium.webdriver.common.by import By from datetime import datetime +from distutils.util import strtobool import time browser = None @@ -72,6 +73,18 @@ '--browser-disable-dev-shm-usage', action='store_true', default=False, help='do not use /dev/shm', ) +parser.add_argument( + '--bbb-hide-meeting-title', + type=bool, + help='hide the meetings title in the top bar (can be set using env)', + default=bool(strtobool(os.environ.get('BBB_HIDE_MEETING_TITLE', '0'))) +) +parser.add_argument( + '--bbb-hide-who-talks', + type=bool, + help='hide the annotation who is currently talking (can be set using env)', + default=bool(strtobool(os.environ.get('BBB_HIDE_WHO_TALKS', '0'))) +) args = parser.parse_args() # some ugly hacks for additional options @@ -196,6 +209,11 @@ def bbb_browser(): browser.execute_script("document.querySelectorAll('div[class^=\"navbar\"] > div[class^=\"top\"] > div[class^=\"center\"] > :not(h1)').forEach((ele) => ele.style.display='none');") browser.execute_script("document.querySelector('div[class^=\"navbar\"] > div[class^=\"top\"] > div[class^=\"right\"]').style.display='none';") + if args.bbb_hide_meeting_title: + browser.execute_script("document.querySelector('div[class^=\"navbar\"] > div[class^=\"top\"]').style.display='none';") + if args.bbb_hide_who_talks: + browser.execute_script("document.querySelector('div[class^=\"navbar\"] > div[class^=\"bottom\"]').style.display='none';") + browser.execute_script("document.querySelector('[aria-label=\"Actions bar\"]').style.display='none';") browser.execute_script("""