add specific messages to permissions errors

This commit is contained in:
Tainan Felipe 2018-05-16 13:53:06 -03:00
parent 91ce8e0e90
commit 0c16518025
2 changed files with 17 additions and 1 deletions

View File

@ -32,6 +32,18 @@ const intlMessages = defineMessages({
id: 'app.video.chromeExtensionErrorLink',
description: 'Error message for Chrome Extension not installed',
},
NotFoundError: {
id: 'app.video.notFoundError',
description: 'error message when can not get webcam video',
},
NotAllowedError: {
id: 'app.video.notAllowed',
description: 'error message when webcam had permission denied',
},
NotSupportedError: {
id: 'app.video.notSupportedError',
description: 'error message when origin do not have ssl valid',
},
});
const CAMERA_SHARE_FAILED_WAIT_TIME = 10000;
@ -364,7 +376,8 @@ class VideoProvider extends Component {
if (error) {
log('error', ' WebRTC peerObj create error');
log('error', error);
that.notifyError(intl.formatMessage(intlMessages.permissionError));
const errorMessage = intlMessages[error.name] || intlMessages.permissionError;
that.notifyError(intl.formatMessage(errorMessage));
/* This notification error is displayed considering kurento-utils
* returned the error 'The request is not allowed by the user agent
* or the platform in the current context.', but there are other

View File

@ -315,6 +315,9 @@
"app.video.iceCandidateError": "Error on adding ice candidate",
"app.video.permissionError": "Error on sharing webcam. Please check permissions",
"app.video.sharingError": "Error on sharing webcam",
"app.video.notFoundError": "Could not get webcam video. Please make sure it's connected",
"app.video.notAllowed": "missing permission for share webcam, please make sure your browser permissions",
"app.video.notSupportedError": "can share webcam video only with safe sources, make sure your SSL certificate is valid",
"app.video.swapCam": "Swap",
"app.video.swapCamDesc": "swap the direction of webcams",
"app.video.videoMenu": "Video menu",