From 868c615d6af1118f71925c2fa1440a6eb8c5d6e6 Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Tue, 31 Jan 2017 08:06:12 -0800 Subject: [PATCH] add getUserMedia failure message --- bigbluebutton-html5/imports/api/phone/index.js | 5 +++++ bigbluebutton-html5/imports/locales/en.json | 1 + .../ui/components/audio-notification/container.jsx | 14 ++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/bigbluebutton-html5/imports/api/phone/index.js b/bigbluebutton-html5/imports/api/phone/index.js index 49a88122bd..f5e17501e4 100755 --- a/bigbluebutton-html5/imports/api/phone/index.js +++ b/bigbluebutton-html5/imports/api/phone/index.js @@ -113,6 +113,11 @@ function joinVoiceCallSIP(options) { status: 'Failed' }); window.dispatchEvent(audioFailed); break; + case 'mediafail': + let mediaFailed = new CustomEvent('bbb.webrtc.mediaFailed', { + status: 'MediaFailed' }); + window.dispatchEvent(mediaFailed); + break; } }, options.isListenOnly, st); return; diff --git a/bigbluebutton-html5/imports/locales/en.json b/bigbluebutton-html5/imports/locales/en.json index 7c619be7f2..25442f286d 100755 --- a/bigbluebutton-html5/imports/locales/en.json +++ b/bigbluebutton-html5/imports/locales/en.json @@ -82,6 +82,7 @@ "app.actionsBar.emojiMenu.thumbsdownLabel": "Thumbs down", "app.actionsBar.emojiMenu.thumbsdownDesc": "Change your status to thumbs down", "app.audioNotification.audioFailedMessage": "Your audio connection failed to connect. Try again.", + "app.audioNotification.mediaFailedMessage": "getUserMicMedia failed, Only secure origins are allowed", "app.breakoutJoinConfirmation.title": "Join Breakout Room", "app.breakoutJoinConfirmation.message": "Do you want to join", "app.breakoutJoinConfirmation.confirmLabel": "Join", diff --git a/bigbluebutton-html5/imports/ui/components/audio-notification/container.jsx b/bigbluebutton-html5/imports/ui/components/audio-notification/container.jsx index 5b693c3065..e275503253 100755 --- a/bigbluebutton-html5/imports/ui/components/audio-notification/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/audio-notification/container.jsx @@ -11,6 +11,10 @@ const intlMessages = defineMessages({ id: 'app.audioNotification.audioFailedMessage', description: 'The audio could not connect, Try again', }, + mediaFailed: { + id: 'app.audioNotification.mediaFailedMessage', + description: 'Could not access getUserMicMedia, Try again', + }, }); class AudioNotificationContainer extends Component { @@ -25,15 +29,18 @@ class AudioNotificationContainer extends Component { } this.handleAudioFailure = this.handleAudioFailure.bind(this); + this.handleMediaFailure = this.handleMediaFailure.bind(this); this.handleClose = this.handleClose.bind(this); } componentDidMount() { window.addEventListener("bbb.webrtc.failed", this.handleAudioFailure); + window.addEventListener("bbb.webrtc.mediaFailed", this.handleMediaFailure); } componentWillUnmount() { window.removeEventListener("bbb.webrtc.failed", this.handleAudioFailure); + window.removeEventListener("bbb.webrtc.mediaFailed", this.handleMediaFailure); } handleClose(){ @@ -48,6 +55,12 @@ class AudioNotificationContainer extends Component { this.setState({status: 'failed'}); } + handleMediaFailure() { + this.color = 'danger'; + this.message = this.props.mediaFailure; + this.setState({status: 'failed'}); + } + render() { const handleClose = this.handleClose; @@ -64,5 +77,6 @@ class AudioNotificationContainer extends Component { export default injectIntl(createContainer(({ intl }) => { let messages = {}; messages.audioFailure = intl.formatMessage(intlMessages.audioFailed); + messages.mediaFailure = intl.formatMessage(intlMessages.mediaFailed); return messages; }, AudioNotificationContainer));