Created
April 7, 2020 10:58
-
-
Save blipp/26a78b9892b0549959ed68b2326ccf8b to your computer and use it in GitHub Desktop.
Bookmarklet for BigBlueButton to mute while only one participant is in the room
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){function mute() { if (document.querySelectorAll('.participantsList--1MvMwF').length <= 1) { document.getElementById('remote-media').muted = true; console.log('Audio muted because there is only one participant.'); } else { console.log('Audio unmuted because there is more than one participant.'); document.getElementById('remote-media').muted = false; }}; mute(); const targetNode = document.getElementsByClassName('userListColumn--6vKQL')[0]; const config = { attributes: true, childList: true, subtree: true }; const callback = function(mutationsList, observer) { for(let mutation of mutationsList) { if (mutation.type === 'childList') { mute() } else if (mutation.type === 'attributes') { console.log('The ' + mutation.attributeName + ' attribute was modified.'); } } }; const observer = new MutationObserver(callback); observer.observe(targetNode, config);})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mute BigBlueButton background music
The free and open source video conferencing system BigBlueButton [1] allows to configure a background music to be streamed when only one person is in a session [2]. The above JavaScript bookmarklet allows to mute sound of the room while only one person is in the room, and thus cutting off the background music. It has only been tested in Firefox, but might work in any other browser.
How to use
This is implemented by simply watching the part of the website's DOM which lists the users in the left sidebar. It's not perfect, you might hear several seconds of the background music before and after someone joins. If it does not work for you, try to find out if the CSS selectors still match those actually used by the page.
[1] https://bigbluebutton.org/
[2] https://docs.bigbluebutton.org/2.2/customize.html#enable-background-music-when-only-one-person-is-in-a-session