From 8158ec6d54c062c6a3c49b92ee5c1fe1e64e969b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 25 May 2017 01:25:17 +0100 Subject: [PATCH] touchups Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/UserSettings.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 58c6bb7c20..0d182b27ab 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -820,8 +820,7 @@ module.exports = React.createClass({ CallMediaHandler.setVideoInput(deviceId); }, - _requestMediaPermissions: function() { - console.log("Request media perms"); + _requestMediaPermissions: function(event) { const getUserMedia = ( window.navigator.getUserMedia || window.navigator.webkitGetUserMedia || window.navigator.mozGetUserMedia ); @@ -829,7 +828,13 @@ module.exports = React.createClass({ return getUserMedia.apply(window.navigator, [ { video: true, audio: true }, this._refreshMediaDevices, - function() {}, + function() { + const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog'); + Modal.createDialog(ErrorDialog, { + title: "No media permissions", + description: "You may need to manually permit Riot to access your microphone/webcam", + }); + }, ]); } }, @@ -839,15 +844,17 @@ module.exports = React.createClass({ return

WebRTC

-
Missing Media Permissions, click to request.
+

+ Missing Media Permissions, click here to request. +

; } else if (!this.state.mediaDevices) return; const Dropdown = sdk.getComponent('elements.Dropdown'); - let microphoneDropdown =
No Microphones detected
; - let webcamDropdown =
No Webcams detected
; + let microphoneDropdown =

No Microphones detected

; + let webcamDropdown =

No Webcams detected

; const audioInputs = this.state.mediaDevices.audioinput; if ('default' in audioInputs) {