fix(context-menus) Don't show volume slider on iOS web

This commit is contained in:
Vlad Piersec 2021-09-16 12:51:13 +03:00 committed by vp8x8
parent 042a2cb447
commit e278703c58
2 changed files with 13 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import React, { Component } from 'react';
import { Avatar } from '../../../base/avatar';
import { isToolbarButtonEnabled } from '../../../base/config/functions.web';
import { openDialog } from '../../../base/dialog';
import { isIosMobileBrowser } from '../../../base/environment/utils';
import { translate } from '../../../base/i18n';
import {
IconCloseCircle,
@ -395,6 +396,11 @@ class MeetingParticipantContextMenu extends Component<Props, State> {
return null;
}
const showVolumeSlider = !isIosMobileBrowser()
&& overflowDrawer
&& typeof _volume === 'number'
&& !isNaN(_volume);
const actions
= _participant?.isFakeParticipant ? (
<>
@ -463,7 +469,7 @@ class MeetingParticipantContextMenu extends Component<Props, State> {
)
}
</ContextMenuItemGroup>
{ overflowDrawer && typeof _volume === 'number' && !isNaN(_volume)
{ showVolumeSlider
&& <ContextMenuItemGroup>
<VolumeSlider
initialValue = { _volume }

View File

@ -5,7 +5,7 @@ import { batch } from 'react-redux';
import ConnectionIndicatorContent from
'../../../../features/connection-indicator/components/web/ConnectionIndicatorContent';
import { isMobileBrowser } from '../../../base/environment/utils';
import { isIosMobileBrowser, isMobileBrowser } from '../../../base/environment/utils';
import { translate } from '../../../base/i18n';
import { Icon, IconMenuThumb } from '../../../base/icons';
import { getLocalParticipant, getParticipantById, PARTICIPANT_ROLE } from '../../../base/participants';
@ -274,6 +274,10 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
} = this.props;
const buttons = [];
const showVolumeSlider = !isIosMobileBrowser()
&& onVolumeChange
&& typeof initialVolumeValue === 'number'
&& !isNaN(initialVolumeValue);
if (_isModerator) {
if (!_disableRemoteMute) {
@ -348,7 +352,7 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
);
}
if (onVolumeChange && typeof initialVolumeValue === 'number' && !isNaN(initialVolumeValue)) {
if (showVolumeSlider) {
buttons.push(
<VolumeSlider
initialValue = { initialVolumeValue }