From 549804c281636656d4f300717bcc43d70ef9faa3 Mon Sep 17 00:00:00 2001 From: Chad Pilkey Date: Tue, 5 Nov 2019 12:08:26 -0800 Subject: [PATCH] add audio cue on user join setting --- .../imports/startup/client/base.jsx | 11 +++++++++ .../ui/components/settings/component.jsx | 1 + .../submenus/application/component.jsx | 23 ++++++++++++++++++ bigbluebutton-html5/private/locales/en.json | 1 + .../public/resources/sounds/userJoin.mp3 | Bin 0 -> 10702 bytes 5 files changed, 36 insertions(+) create mode 100644 bigbluebutton-html5/public/resources/sounds/userJoin.mp3 diff --git a/bigbluebutton-html5/imports/startup/client/base.jsx b/bigbluebutton-html5/imports/startup/client/base.jsx index 2230a1bac5..27175f8767 100755 --- a/bigbluebutton-html5/imports/startup/client/base.jsx +++ b/bigbluebutton-html5/imports/startup/client/base.jsx @@ -311,6 +311,17 @@ const BaseContainer = withTracker(() => { }, }); + Users.find({}, { fields: { validated: 1 } }).observe({ + changed: (newDocument, oldDocument) => { + if (Settings.application.userJoinAudioAlerts + && !oldDocument.validated + && newDocument.validated) { + const audio = new Audio(`${Meteor.settings.public.app.cdn + Meteor.settings.public.app.basename}/resources/sounds/userJoin.mp3`); + audio.play(); + } + }, + }); + return { approved, ejected, diff --git a/bigbluebutton-html5/imports/ui/components/settings/component.jsx b/bigbluebutton-html5/imports/ui/components/settings/component.jsx index 587a401b10..0db1410ba6 100644 --- a/bigbluebutton-html5/imports/ui/components/settings/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/settings/component.jsx @@ -69,6 +69,7 @@ const propTypes = { application: PropTypes.shape({ chatAudioAlerts: PropTypes.bool, chatPushAlerts: PropTypes.bool, + userJoinAudioAlerts: PropTypes.bool, fallbackLocale: PropTypes.string, fontSize: PropTypes.string, locale: PropTypes.string, diff --git a/bigbluebutton-html5/imports/ui/components/settings/submenus/application/component.jsx b/bigbluebutton-html5/imports/ui/components/settings/submenus/application/component.jsx index a92d20bdfc..fdb3438a2d 100644 --- a/bigbluebutton-html5/imports/ui/components/settings/submenus/application/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/settings/submenus/application/component.jsx @@ -26,6 +26,10 @@ const intlMessages = defineMessages({ id: 'app.submenu.application.pushAlertLabel', description: 'push notifiation label', }, + userJoinAudioAlertLabel: { + id: 'app.submenu.application.userJoinAudioAlertLabel', + description: 'audio notification when a user joins', + }, fontSizeControlLabel: { id: 'app.submenu.application.fontSizeControlLabel', description: 'label for font size ontrol', @@ -240,6 +244,25 @@ class ApplicationMenu extends BaseMenu { ) : null } +
+ +
+
+ this.handleToggle('userJoinAudioAlerts')} + ariaLabel={intl.formatMessage(intlMessages.userJoinAudioAlertLabel)} + /> +
+
+