| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 | 
							- // @flow
 - 
 - import React from 'react';
 - 
 - import { sendEvent } from '../analytics';
 - import { ParticipantCounter } from '../contact-list';
 - import { openDeviceSelectionDialog } from '../device-selection';
 - import { InfoDialogButton, openInviteDialog } from '../invite';
 - import UIEvents from '../../../service/UI/UIEvents';
 - import { VideoQualityButton } from '../video-quality';
 - 
 - import ProfileButton from './components/ProfileButton';
 - 
 - declare var APP: Object;
 - declare var interfaceConfig: Object;
 - 
 - /**
 -  * The cache of {@link getDefaultButtons()}.
 -  */
 - let defaultButtons: Object;
 - 
 - /**
 -  * Returns a map of all button descriptors and according properties.
 -  *
 -  * @returns {Object} - The maps of default button descriptors.
 -  */
 - export default function getDefaultButtons() {
 -     if (defaultButtons) {
 -         return defaultButtons;
 -     }
 - 
 -     defaultButtons = {
 -         /**
 -          * The descriptor of the camera toolbar button.
 -          */
 -         camera: {
 -             classNames: [ 'button', 'icon-camera' ],
 -             enabled: true,
 -             isDisplayed: () => true,
 -             id: 'toolbar_button_camera',
 -             onClick() {
 -                 const newVideoMutedState = !APP.conference.isLocalVideoMuted();
 - 
 -                 if (newVideoMutedState) {
 -                     sendEvent('toolbar.video.enabled');
 -                 } else {
 -                     sendEvent('toolbar.video.disabled');
 -                 }
 -                 APP.UI.emitEvent(UIEvents.VIDEO_MUTED, newVideoMutedState);
 -             },
 -             popups: [
 -                 {
 -                     dataAttr: 'audioOnly.featureToggleDisabled',
 -                     dataInterpolate: { feature: 'video mute' },
 -                     id: 'unmuteWhileAudioOnly'
 -                 }
 -             ],
 -             shortcut: 'V',
 -             shortcutAttr: 'toggleVideoPopover',
 -             shortcutFunc() {
 -                 if (APP.conference.isAudioOnly()) {
 -                     APP.UI.emitEvent(UIEvents.VIDEO_UNMUTING_WHILE_AUDIO_ONLY);
 - 
 -                     return;
 -                 }
 - 
 -                 sendEvent('shortcut.videomute.toggled');
 -                 APP.conference.toggleVideoMuted();
 -             },
 -             shortcutDescription: 'keyboardShortcuts.videoMute',
 -             tooltipKey: 'toolbar.videomute'
 -         },
 - 
 -         /**
 -          * The descriptor of the chat toolbar button.
 -          */
 -         chat: {
 -             classNames: [ 'button', 'icon-chat' ],
 -             enabled: true,
 -             html: <span className = 'badge-round'>
 -                 <span id = 'unreadMessages' /></span>,
 -             id: 'toolbar_button_chat',
 -             onClick() {
 -                 sendEvent('toolbar.chat.toggled');
 -                 APP.UI.emitEvent(UIEvents.TOGGLE_CHAT);
 -             },
 -             shortcut: 'C',
 -             shortcutAttr: 'toggleChatPopover',
 -             shortcutFunc() {
 -                 sendEvent('shortcut.chat.toggled');
 -                 APP.UI.toggleChat();
 -             },
 -             shortcutDescription: 'keyboardShortcuts.toggleChat',
 -             sideContainerId: 'chat_container',
 -             tooltipKey: 'toolbar.chat'
 -         },
 - 
 -         /**
 -          * The descriptor of the contact list toolbar button.
 -          */
 -         contacts: {
 -             childComponent: ParticipantCounter,
 -             classNames: [ 'button', 'icon-contactList' ],
 -             enabled: true,
 -             id: 'toolbar_contact_list',
 -             onClick() {
 -                 sendEvent(
 -                     'toolbar.contacts.toggled');
 -                 APP.UI.emitEvent(UIEvents.TOGGLE_CONTACT_LIST);
 -             },
 -             sideContainerId: 'contacts_container',
 -             tooltipKey: 'bottomtoolbar.contactlist'
 -         },
 - 
 -         /**
 -          * The descriptor of the desktop sharing toolbar button.
 -          */
 -         desktop: {
 -             classNames: [ 'button', 'icon-share-desktop' ],
 -             enabled: true,
 -             id: 'toolbar_button_desktopsharing',
 -             onClick() {
 -                 if (APP.conference.isSharingScreen) {
 -                     sendEvent('toolbar.screen.disabled');
 -                 } else {
 -                     sendEvent('toolbar.screen.enabled');
 -                 }
 -                 APP.UI.emitEvent(UIEvents.TOGGLE_SCREENSHARING);
 -             },
 -             popups: [
 -                 {
 -                     dataAttr: 'audioOnly.featureToggleDisabled',
 -                     dataInterpolate: { feature: 'screen sharing' },
 -                     id: 'screenshareWhileAudioOnly'
 -                 }
 -             ],
 -             shortcut: 'D',
 -             shortcutAttr: 'toggleDesktopSharingPopover',
 -             shortcutFunc() {
 -                 sendEvent('shortcut.screen.toggled');
 - 
 -                 // eslint-disable-next-line no-empty-function
 -                 APP.conference.toggleScreenSharing().catch(() => {});
 -             },
 -             shortcutDescription: 'keyboardShortcuts.toggleScreensharing',
 -             tooltipKey: 'toolbar.sharescreen'
 -         },
 - 
 -         /**
 -          * The descriptor of the device selection toolbar button.
 -          */
 -         fodeviceselection: {
 -             classNames: [ 'button', 'icon-settings' ],
 -             enabled: true,
 -             isDisplayed() {
 -                 return interfaceConfig.filmStripOnly;
 -             },
 -             id: 'toolbar_button_fodeviceselection',
 -             onClick(dispatch: Function) {
 -                 sendEvent(
 -                     'toolbar.fodeviceselection.toggled');
 - 
 -                 dispatch(openDeviceSelectionDialog());
 -             },
 -             sideContainerId: 'settings_container',
 -             tooltipKey: 'toolbar.Settings'
 -         },
 - 
 -         /**
 -          * The descriptor of the dialpad toolbar button.
 -          */
 -         dialpad: {
 -             classNames: [ 'button', 'icon-dialpad' ],
 -             enabled: true,
 - 
 -             // TODO: remove it after UI.updateDTMFSupport fix
 -             hidden: true,
 -             id: 'toolbar_button_dialpad',
 -             onClick() {
 -                 sendEvent('toolbar.sip.dialpad.clicked');
 -             },
 -             tooltipKey: 'toolbar.dialpad'
 -         },
 - 
 -         /**
 -          * The descriptor of the etherpad toolbar button.
 -          */
 -         etherpad: {
 -             classNames: [ 'button', 'icon-share-doc' ],
 -             enabled: true,
 -             hidden: true,
 -             id: 'toolbar_button_etherpad',
 -             onClick() {
 -                 sendEvent('toolbar.etherpad.clicked');
 -                 APP.UI.emitEvent(UIEvents.ETHERPAD_CLICKED);
 -             },
 -             tooltipKey: 'toolbar.etherpad'
 -         },
 - 
 -         /**
 -          * The descriptor of the toolbar button which toggles full-screen mode.
 -          */
 -         fullscreen: {
 -             classNames: [ 'button', 'icon-full-screen' ],
 -             enabled: true,
 -             id: 'toolbar_button_fullScreen',
 -             onClick() {
 -                 sendEvent('toolbar.fullscreen.enabled');
 - 
 -                 APP.UI.emitEvent(UIEvents.TOGGLE_FULLSCREEN);
 -             },
 -             shortcut: 'S',
 -             shortcutAttr: 'toggleFullscreenPopover',
 -             shortcutDescription: 'keyboardShortcuts.fullScreen',
 -             shortcutFunc() {
 -                 sendEvent('shortcut.fullscreen.toggled');
 -                 APP.UI.toggleFullScreen();
 -             },
 -             tooltipKey: 'toolbar.fullscreen'
 -         },
 - 
 -         /**
 -          * The descriptor of the toolbar button which hangs up the
 -          * call/conference.
 -          */
 -         hangup: {
 -             classNames: [ 'button', 'icon-hangup', 'button_hangup' ],
 -             enabled: true,
 -             isDisplayed: () => true,
 -             id: 'toolbar_button_hangup',
 -             onClick() {
 -                 sendEvent('toolbar.hangup');
 -                 APP.UI.emitEvent(UIEvents.HANGUP);
 -             },
 -             tooltipKey: 'toolbar.hangup'
 -         },
 - 
 -         /**
 -          * The descriptor of the toolbar button which opens a dialog for the
 -          * conference URL and inviting others.
 -          */
 -         info: {
 -             component: InfoDialogButton
 -         },
 - 
 -         /**
 -          * The descriptor of the toolbar button which shows the invite user
 -          * dialog.
 -          */
 -         invite: {
 -             classNames: [ 'button', 'icon-link' ],
 -             enabled: true,
 -             id: 'toolbar_button_link',
 -             onClick(dispatch: Function) {
 -                 sendEvent('toolbar.invite.clicked');
 - 
 -                 dispatch(openInviteDialog());
 -             },
 -             tooltipKey: 'toolbar.invite'
 -         },
 - 
 -         /**
 -          * The descriptor of the microphone toolbar button.
 -          */
 -         microphone: {
 -             classNames: [ 'button', 'icon-microphone' ],
 -             enabled: true,
 -             isDisplayed: () => true,
 -             id: 'toolbar_button_mute',
 -             onClick() {
 -                 const sharedVideoManager = APP.UI.getSharedVideoManager();
 - 
 -                 if (APP.conference.isLocalAudioMuted()) {
 -                     // If there's a shared video with the volume "on" and we
 -                     // aren't the video owner, we warn the user
 -                     // that currently it's not possible to unmute.
 -                     if (sharedVideoManager
 -                         && sharedVideoManager.isSharedVideoVolumeOn()
 -                         && !sharedVideoManager.isSharedVideoOwner()) {
 -                         APP.UI.showCustomToolbarPopup(
 -                             'microphone', 'unableToUnmutePopup', true, 5000);
 -                     } else {
 -                         sendEvent('toolbar.audio.unmuted');
 -                         APP.UI.emitEvent(UIEvents.AUDIO_MUTED, false, true);
 -                     }
 -                 } else {
 -                     sendEvent('toolbar.audio.muted');
 -                     APP.UI.emitEvent(UIEvents.AUDIO_MUTED, true, true);
 -                 }
 -             },
 -             popups: [
 -                 {
 -                     dataAttr: 'toolbar.micMutedPopup',
 -                     id: 'micMutedPopup'
 -                 },
 -                 {
 -                     dataAttr: 'toolbar.unableToUnmutePopup',
 -                     id: 'unableToUnmutePopup'
 -                 },
 -                 {
 -                     dataAttr: 'toolbar.talkWhileMutedPopup',
 -                     id: 'talkWhileMutedPopup'
 -                 }
 -             ],
 -             shortcut: 'M',
 -             shortcutAttr: 'mutePopover',
 -             shortcutFunc() {
 -                 sendEvent('shortcut.audiomute.toggled');
 -                 APP.conference.toggleAudioMuted();
 -             },
 -             shortcutDescription: 'keyboardShortcuts.mute',
 -             tooltipKey: 'toolbar.mute'
 -         },
 - 
 -         /**
 -          * The descriptor of the profile toolbar button.
 -          */
 -         profile: {
 -             component: ProfileButton,
 -             sideContainerId: 'profile_container'
 -         },
 - 
 -         /**
 -          * The descriptor of the "Raise hand" toolbar button.
 -          */
 -         raisehand: {
 -             classNames: [ 'button', 'icon-raised-hand' ],
 -             enabled: true,
 -             id: 'toolbar_button_raisehand',
 -             onClick() {
 -                 sendEvent('toolbar.raiseHand.clicked');
 -                 APP.conference.maybeToggleRaisedHand();
 -             },
 -             shortcut: 'R',
 -             shortcutAttr: 'raiseHandPopover',
 -             shortcutDescription: 'keyboardShortcuts.raiseHand',
 -             shortcutFunc() {
 -                 sendEvent('shortcut.raisehand.clicked');
 -                 APP.conference.maybeToggleRaisedHand();
 -             },
 -             tooltipKey: 'toolbar.raiseHand'
 -         },
 - 
 -         /**
 -          * The descriptor of the recording toolbar button. Requires additional
 -          * initialization in the recording module.
 -          */
 -         recording: {
 -             classNames: [ 'button' ],
 -             enabled: true,
 - 
 -             // will be displayed once the recording functionality is detected
 -             hidden: true,
 -             id: 'toolbar_button_record',
 -             tooltipKey: 'liveStreaming.buttonTooltip'
 -         },
 - 
 -         /**
 -          * The descriptor of the settings toolbar button.
 -          */
 -         settings: {
 -             classNames: [ 'button', 'icon-settings' ],
 -             enabled: true,
 -             id: 'toolbar_button_settings',
 -             onClick() {
 -                 sendEvent('toolbar.settings.toggled');
 -                 APP.UI.emitEvent(UIEvents.TOGGLE_SETTINGS);
 -             },
 -             sideContainerId: 'settings_container',
 -             tooltipKey: 'toolbar.Settings'
 -         },
 - 
 -         /**
 -          * The descriptor of the "Share YouTube video" toolbar button.
 -          */
 -         sharedvideo: {
 -             classNames: [ 'button', 'icon-shared-video' ],
 -             enabled: true,
 -             id: 'toolbar_button_sharedvideo',
 -             onClick() {
 -                 sendEvent('toolbar.sharedvideo.clicked');
 -                 APP.UI.emitEvent(UIEvents.SHARED_VIDEO_CLICKED);
 -             },
 -             popups: [
 -                 {
 -                     dataAttr: 'toolbar.sharedVideoMutedPopup',
 -                     id: 'sharedVideoMutedPopup'
 -                 }
 -             ],
 -             tooltipKey: 'toolbar.sharedvideo'
 -         },
 - 
 -         videoquality: {
 -             component: VideoQualityButton
 -         }
 -     };
 - 
 -     Object.keys(defaultButtons).forEach(name => {
 -         const button = defaultButtons[name];
 - 
 -         if (!button.isDisplayed) {
 -             button.isDisplayed = _isDisplayed;
 -         }
 -     });
 - 
 -     return defaultButtons;
 - }
 - 
 - /**
 -  * The default implementation of the {@code isDisplayed} method of the toolbar
 -  * button definition returned by {@link getDefaultButtons()}.
 -  *
 -  * @returns {boolean} If the user intarface is full i.e. not filmstrip-only,
 -  * then {@code true}; otherwise, {@code false}.
 -  */
 - function _isDisplayed() {
 -     return !interfaceConfig.filmStripOnly;
 - }
 
 
  |