From d12707b14d1aab1506f3266b23332454dd0fd894 Mon Sep 17 00:00:00 2001
From: Chad Pilkey
Date: Thu, 28 Mar 2019 14:53:42 -0700
Subject: [PATCH] add modal warnings for edge users
---
.../audio/audio-modal/component.jsx | 72 ++++++++++++-------
.../audio/audio-modal/container.jsx | 1 +
.../components/audio/audio-modal/styles.scss | 8 +++
.../ui/components/video-preview/component.jsx | 30 ++++++--
.../ui/components/video-preview/styles.scss | 8 +++
bigbluebutton-html5/private/locales/en.json | 1 +
6 files changed, 87 insertions(+), 33 deletions(-)
mode change 100644 => 100755 bigbluebutton-html5/imports/ui/components/video-preview/styles.scss
diff --git a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx
index 6d46222a19..4c8fe30c15 100755
--- a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx
@@ -1,8 +1,11 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
+import cx from 'classnames';
import Modal from '/imports/ui/components/modal/simple/component';
import Button from '/imports/ui/components/button/component';
-import { defineMessages, injectIntl, intlShape } from 'react-intl';
+import {
+ defineMessages, injectIntl, intlShape, FormattedMessage,
+} from 'react-intl';
import { styles } from './styles';
import PermissionsOverlay from '../permissions-overlay/component';
import AudioSettings from '../audio-settings/component';
@@ -264,38 +267,53 @@ class AudioModal extends Component {
skipCheck,
audioLocked,
isMobileNative,
+ isIEOrEdge,
} = this.props;
const showMicrophone = forceListenOnlyAttendee || audioLocked;
return (
-
- {!showMicrophone && !isMobileNative
- ? (
-
+
+ ) : null }
+
);
}
diff --git a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/container.jsx b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/container.jsx
index ea3ab2f2cf..644bc0c309 100755
--- a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/container.jsx
+++ b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/container.jsx
@@ -63,5 +63,6 @@ export default withModalMounter(withTracker(({ mountModal }) => {
forceListenOnlyAttendee: listenOnlyMode && forceListenOnly && !Service.isUserModerator(),
isIOSChrome: browser().name === 'crios',
isMobileNative: navigator.userAgent.toLowerCase().includes('bbbnative'),
+ isIEOrEdge: browser().name === 'edge' || browser().name === 'ie',
});
})(AudioModalContainer));
diff --git a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/styles.scss b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/styles.scss
index 293250ebf8..61735f47db 100755
--- a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/styles.scss
+++ b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/styles.scss
@@ -33,6 +33,14 @@
margin-top: auto;
margin-bottom: auto;
display: flex;
+ justify-content: center;
+}
+
+.browserWarning {
+ padding: 0.5rem;
+ border-width: 3px;
+ border-style: solid;
+ border-radius: 0.25rem;
}
.overlay {
diff --git a/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx b/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx
index a223f72b6c..a27ab13922 100755
--- a/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/video-preview/component.jsx
@@ -1,12 +1,16 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
-import { defineMessages, injectIntl, intlShape } from 'react-intl';
+import {
+ defineMessages, injectIntl, intlShape, FormattedMessage,
+} from 'react-intl';
import Button from '/imports/ui/components/button/component';
import { notify } from '/imports/ui/services/notification';
import logger from '/imports/startup/client/logger';
import Modal from '/imports/ui/components/modal/simple/component';
+import browser from 'browser-detect';
import { styles } from './styles';
+
const VIDEO_CONSTRAINTS = Meteor.settings.public.kurento.cameraConstraints;
const propTypes = {
@@ -174,7 +178,6 @@ class VideoPreview extends Component {
}
constraints.video.deviceId = { exact: this.state.webcamDeviceId };
-
try {
await navigator.mediaDevices.getUserMedia(constraints);
} catch (exception) {
@@ -209,13 +212,16 @@ class VideoPreview extends Component {
}
async webcamListener() {
- const { cameraAllowed, isInitialDeviceSet } = this.state;
+ const { cameraAllowed, isInitialDeviceSet, isStartSharingDisabled } = this.state;
const getDevices = await navigator.mediaDevices.enumerateDevices();
const hasVideoInput = getDevices.filter(device => device.kind === 'videoinput').length > 0;
- this.setState({
- isStartSharingDisabled: !(hasVideoInput && cameraAllowed && isInitialDeviceSet),
- });
+ const newSharingDisabled = !(hasVideoInput && cameraAllowed && isInitialDeviceSet);
+ if (newSharingDisabled !== isStartSharingDisabled) {
+ this.setState({
+ isStartSharingDisabled: newSharingDisabled,
+ });
+ }
}
handleJoinVideo() {
@@ -287,6 +293,18 @@ class VideoPreview extends Component {
)}
+ {browser().name === 'edge' || browser().name === 'ie' ? (
+
+ Chrome,
+ 1: Firefox,
+ }}
+ />
+
+ ) : null }