Merge pull request #7130 from capilkey/edge-html5-warnings

Add modal warnings for edge users
This commit is contained in:
Chad Pilkey 2019-03-28 18:40:51 -04:00 committed by GitHub
commit 45c1e1b0a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 87 additions and 33 deletions

View File

@ -1,8 +1,11 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import cx from 'classnames';
import Modal from '/imports/ui/components/modal/simple/component'; import Modal from '/imports/ui/components/modal/simple/component';
import Button from '/imports/ui/components/button/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 { styles } from './styles';
import PermissionsOverlay from '../permissions-overlay/component'; import PermissionsOverlay from '../permissions-overlay/component';
import AudioSettings from '../audio-settings/component'; import AudioSettings from '../audio-settings/component';
@ -264,38 +267,53 @@ class AudioModal extends Component {
skipCheck, skipCheck,
audioLocked, audioLocked,
isMobileNative, isMobileNative,
isIEOrEdge,
} = this.props; } = this.props;
const showMicrophone = forceListenOnlyAttendee || audioLocked; const showMicrophone = forceListenOnlyAttendee || audioLocked;
return ( return (
<span className={styles.audioOptions}> <div>
{!showMicrophone && !isMobileNative <span className={styles.audioOptions}>
? ( {!showMicrophone && !isMobileNative
<Button ? (
className={styles.audioBtn} <Button
label={intl.formatMessage(intlMessages.microphoneLabel)} className={styles.audioBtn}
icon="unmute" label={intl.formatMessage(intlMessages.microphoneLabel)}
circle icon="unmute"
size="jumbo" circle
disabled={audioLocked} size="jumbo"
onClick={skipCheck ? this.handleJoinMicrophone : this.handleGoToEchoTest} disabled={audioLocked}
onClick={skipCheck ? this.handleJoinMicrophone : this.handleGoToEchoTest}
/>
)
: null}
{listenOnlyMode
? (
<Button
className={styles.audioBtn}
label={intl.formatMessage(intlMessages.listenOnlyLabel)}
icon="listen"
circle
size="jumbo"
onClick={this.handleJoinListenOnly}
/>
)
: null}
</span>
{isIEOrEdge ? (
<p className={cx(styles.text, styles.browserWarning)}>
<FormattedMessage
id="app.audioModal.unsupportedBrowserLabel"
description="Warning when someone joins with a browser that isnt supported"
values={{
0: <a href="https://www.google.com/chrome/">Chrome</a>,
1: <a href="https://getfirefox.com">Firefox</a>,
}}
/> />
) </p>
: null} ) : null }
{listenOnlyMode </div>
? (
<Button
className={styles.audioBtn}
label={intl.formatMessage(intlMessages.listenOnlyLabel)}
icon="listen"
circle
size="jumbo"
onClick={this.handleJoinListenOnly}
/>
)
: null}
</span>
); );
} }

View File

@ -63,5 +63,6 @@ export default withModalMounter(withTracker(({ mountModal }) => {
forceListenOnlyAttendee: listenOnlyMode && forceListenOnly && !Service.isUserModerator(), forceListenOnlyAttendee: listenOnlyMode && forceListenOnly && !Service.isUserModerator(),
isIOSChrome: browser().name === 'crios', isIOSChrome: browser().name === 'crios',
isMobileNative: navigator.userAgent.toLowerCase().includes('bbbnative'), isMobileNative: navigator.userAgent.toLowerCase().includes('bbbnative'),
isIEOrEdge: browser().name === 'edge' || browser().name === 'ie',
}); });
})(AudioModalContainer)); })(AudioModalContainer));

View File

@ -33,6 +33,14 @@
margin-top: auto; margin-top: auto;
margin-bottom: auto; margin-bottom: auto;
display: flex; display: flex;
justify-content: center;
}
.browserWarning {
padding: 0.5rem;
border-width: 3px;
border-style: solid;
border-radius: 0.25rem;
} }
.overlay { .overlay {

View File

@ -1,12 +1,16 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { Component } from 'react'; 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 Button from '/imports/ui/components/button/component';
import { notify } from '/imports/ui/services/notification'; import { notify } from '/imports/ui/services/notification';
import logger from '/imports/startup/client/logger'; import logger from '/imports/startup/client/logger';
import Modal from '/imports/ui/components/modal/simple/component'; import Modal from '/imports/ui/components/modal/simple/component';
import browser from 'browser-detect';
import { styles } from './styles'; import { styles } from './styles';
const VIDEO_CONSTRAINTS = Meteor.settings.public.kurento.cameraConstraints; const VIDEO_CONSTRAINTS = Meteor.settings.public.kurento.cameraConstraints;
const propTypes = { const propTypes = {
@ -174,7 +178,6 @@ class VideoPreview extends Component {
} }
constraints.video.deviceId = { exact: this.state.webcamDeviceId }; constraints.video.deviceId = { exact: this.state.webcamDeviceId };
try { try {
await navigator.mediaDevices.getUserMedia(constraints); await navigator.mediaDevices.getUserMedia(constraints);
} catch (exception) { } catch (exception) {
@ -209,13 +212,16 @@ class VideoPreview extends Component {
} }
async webcamListener() { async webcamListener() {
const { cameraAllowed, isInitialDeviceSet } = this.state; const { cameraAllowed, isInitialDeviceSet, isStartSharingDisabled } = this.state;
const getDevices = await navigator.mediaDevices.enumerateDevices(); const getDevices = await navigator.mediaDevices.enumerateDevices();
const hasVideoInput = getDevices.filter(device => device.kind === 'videoinput').length > 0; const hasVideoInput = getDevices.filter(device => device.kind === 'videoinput').length > 0;
this.setState({ const newSharingDisabled = !(hasVideoInput && cameraAllowed && isInitialDeviceSet);
isStartSharingDisabled: !(hasVideoInput && cameraAllowed && isInitialDeviceSet), if (newSharingDisabled !== isStartSharingDisabled) {
}); this.setState({
isStartSharingDisabled: newSharingDisabled,
});
}
} }
handleJoinVideo() { handleJoinVideo() {
@ -287,6 +293,18 @@ class VideoPreview extends Component {
)} )}
</div> </div>
</div> </div>
{browser().name === 'edge' || browser().name === 'ie' ? (
<p className={styles.browserWarning}>
<FormattedMessage
id="app.audioModal.unsupportedBrowserLabel"
description="Warning when someone joins with a browser that isnt supported"
values={{
0: <a href="https://www.google.com/chrome/">Chrome</a>,
1: <a href="https://getfirefox.com">Firefox</a>,
}}
/>
</p>
) : null }
<div className={styles.footer}> <div className={styles.footer}>
<div className={styles.actions}> <div className={styles.actions}>
<Button <Button

View File

@ -90,3 +90,11 @@
text-align: center; text-align: center;
} }
.browserWarning {
padding: 0.5rem;
border-width: 3px;
border-style: solid;
border-radius: 0.25rem;
margin: var(--line-height-computed);
text-align: center;
}

View File

@ -339,6 +339,7 @@
"app.audioModal.iOSErrorDescription": "At this time audio and video are not supported on Chrome for iOS.", "app.audioModal.iOSErrorDescription": "At this time audio and video are not supported on Chrome for iOS.",
"app.audioModal.iOSErrorRecommendation": "We recommend using Safari iOS.", "app.audioModal.iOSErrorRecommendation": "We recommend using Safari iOS.",
"app.audioModal.audioChoiceDesc": "Select how to join the audio in this meeting", "app.audioModal.audioChoiceDesc": "Select how to join the audio in this meeting",
"app.audioModal.unsupportedBrowserLabel": "It looks like you're using a browser that is not fully supported. Please use either {0} or {1} for full support.",
"app.audioModal.closeLabel": "Close", "app.audioModal.closeLabel": "Close",
"app.audioModal.yes": "Yes", "app.audioModal.yes": "Yes",
"app.audioModal.no": "No", "app.audioModal.no": "No",