_renderRemoteVideoMenu()

in react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.js [247:375]


    _renderRemoteVideoMenu() {
        const {
            _disableKick,
            _disableRemoteMute,
            _disableGrantModerator,
            _isModerator,
            dispatch,
            initialVolumeValue,
            onVolumeChange,
            _remoteControlState,
            participantID
        } = this.props;

        const actions = [];
        const buttons = [];
        const showVolumeSlider = !isIosMobileBrowser()
              && onVolumeChange
              && typeof initialVolumeValue === 'number'
              && !isNaN(initialVolumeValue);

        if (_isModerator) {
            if (!_disableRemoteMute) {
                buttons.push(
                    <MuteButton
                        key = 'mute'
                        participantID = { participantID } />
                );
                buttons.push(
                    <MuteEveryoneElseButton
                        key = 'mute-others'
                        participantID = { participantID } />
                );
                buttons.push(
                    <MuteVideoButton
                        key = 'mute-video'
                        participantID = { participantID } />
                );
                buttons.push(
                    <MuteEveryoneElsesVideoButton
                        key = 'mute-others-video'
                        participantID = { participantID } />
                );
            }

            if (!_disableGrantModerator) {
                buttons.push(
                    <GrantModeratorButton
                        key = 'grant-moderator'
                        participantID = { participantID } />
                );
            }

            if (!_disableKick) {
                buttons.push(
                    <KickButton
                        key = 'kick'
                        participantID = { participantID } />
                );
            }
        }

        if (_remoteControlState) {
            let onRemoteControlToggle = null;

            if (_remoteControlState === REMOTE_CONTROL_MENU_STATES.STARTED) {
                onRemoteControlToggle = () => dispatch(stopController(true));
            } else if (_remoteControlState === REMOTE_CONTROL_MENU_STATES.NOT_STARTED) {
                onRemoteControlToggle = () => dispatch(requestRemoteControl(participantID));
            }

            buttons.push(
                <RemoteControlButton
                    key = 'remote-control'
                    onClick = { onRemoteControlToggle }
                    participantID = { participantID }
                    remoteControlState = { _remoteControlState } />
            );
        }

        buttons.push(
            <PrivateMessageMenuButton
                key = 'privateMessage'
                participantID = { participantID } />
        );

        if (isMobileBrowser()) {
            actions.push(
                <ConnectionStatusButton
                    key = 'conn-status'
                    participantId = { participantID } />
            );
        }

        if (showVolumeSlider) {
            actions.push(
                <VolumeSlider
                    initialValue = { initialVolumeValue }
                    key = 'volume-slider'
                    onChange = { onVolumeChange } />
            );
        }

        if (buttons.length > 0 || actions.length > 0) {
            return (
                <VideoMenu id = { participantID }>
                    <>
                        { buttons.length > 0
                          && <li onClick = { this.props.hidePopover }>
                              <ul className = 'popupmenu__list'>
                                  { buttons }
                              </ul>
                          </li>
                        }
                    </>
                    <>
                        { actions.length > 0
                         && <li>
                             <ul className = 'popupmenu__list'>
                                 {actions}
                             </ul>
                         </li>
                        }
                    </>
                </VideoMenu>
            );
        }

        return null;
    }