|
@@ -1,16 +1,16 @@
|
1
|
1
|
/* @flow */
|
2
|
2
|
|
3
|
3
|
import React from 'react';
|
|
4
|
+import _ from 'lodash';
|
4
|
5
|
|
5
|
6
|
import { ParticipantCounter } from '../contact-list';
|
6
|
7
|
import { openDeviceSelectionDialog } from '../device-selection';
|
7
|
|
-import { openDialOutDialog } from '../dial-out';
|
8
|
8
|
|
9
|
9
|
import {
|
10
|
10
|
InfoDialogButton,
|
11
|
|
- openAddPeopleDialog,
|
12
|
11
|
openInviteDialog
|
13
|
12
|
} from '../invite';
|
|
13
|
+
|
14
|
14
|
import { VideoQualityButton } from '../video-quality';
|
15
|
15
|
|
16
|
16
|
import UIEvents from '../../../service/UI/UIEvents';
|
|
@@ -21,412 +21,394 @@ declare var APP: Object;
|
21
|
21
|
declare var interfaceConfig: Object;
|
22
|
22
|
declare var JitsiMeetJS: Object;
|
23
|
23
|
|
|
24
|
+let buttons: Object = {};
|
|
25
|
+
|
24
|
26
|
/**
|
25
|
|
- * All toolbar buttons' descriptors.
|
|
27
|
+ * Returns a map of all button descriptors and according properties.
|
|
28
|
+ *
|
|
29
|
+ * @returns {*} - The maps of default button descriptors.
|
26
|
30
|
*/
|
27
|
|
-const buttons: Object = {
|
28
|
|
- addtocall: {
|
29
|
|
- classNames: [ 'button', 'icon-add' ],
|
30
|
|
- enabled: true,
|
31
|
|
- id: 'toolbar_button_add',
|
32
|
|
- isDisplayed: () => !APP.store.getState()['features/jwt'].isGuest,
|
33
|
|
- onClick(dispatch) {
|
34
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.add.clicked');
|
35
|
|
-
|
36
|
|
- dispatch(openAddPeopleDialog());
|
37
|
|
- },
|
38
|
|
- tooltipKey: 'toolbar.addPeople'
|
39
|
|
- },
|
40
|
|
-
|
41
|
|
- /**
|
42
|
|
- * The descriptor of the camera toolbar button.
|
43
|
|
- */
|
44
|
|
- camera: {
|
45
|
|
- classNames: [ 'button', 'icon-camera' ],
|
46
|
|
- enabled: true,
|
47
|
|
- isDisplayed: () => true,
|
48
|
|
- id: 'toolbar_button_camera',
|
49
|
|
- onClick() {
|
50
|
|
- const newVideoMutedState = !APP.conference.isLocalVideoMuted();
|
51
|
|
-
|
52
|
|
- if (newVideoMutedState) {
|
53
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.video.enabled');
|
54
|
|
- } else {
|
55
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.video.disabled');
|
56
|
|
- }
|
57
|
|
- APP.UI.emitEvent(UIEvents.VIDEO_MUTED, newVideoMutedState);
|
58
|
|
- },
|
59
|
|
- popups: [
|
60
|
|
- {
|
61
|
|
- dataAttr: 'audioOnly.featureToggleDisabled',
|
62
|
|
- dataInterpolate: { feature: 'video mute' },
|
63
|
|
- id: 'unmuteWhileAudioOnly'
|
64
|
|
- }
|
65
|
|
- ],
|
66
|
|
- shortcut: 'V',
|
67
|
|
- shortcutAttr: 'toggleVideoPopover',
|
68
|
|
- shortcutFunc() {
|
69
|
|
- if (APP.conference.isAudioOnly()) {
|
70
|
|
- APP.UI.emitEvent(UIEvents.VIDEO_UNMUTING_WHILE_AUDIO_ONLY);
|
71
|
|
-
|
72
|
|
- return;
|
73
|
|
- }
|
74
|
|
-
|
75
|
|
- JitsiMeetJS.analytics.sendEvent('shortcut.videomute.toggled');
|
76
|
|
- APP.conference.toggleVideoMuted();
|
77
|
|
- },
|
78
|
|
- shortcutDescription: 'keyboardShortcuts.videoMute',
|
79
|
|
- tooltipKey: 'toolbar.videomute'
|
80
|
|
- },
|
81
|
|
-
|
82
|
|
- /**
|
83
|
|
- * The descriptor of the chat toolbar button.
|
84
|
|
- */
|
85
|
|
- chat: {
|
86
|
|
- classNames: [ 'button', 'icon-chat' ],
|
87
|
|
- enabled: true,
|
88
|
|
- html: <span className = 'badge-round'>
|
89
|
|
- <span id = 'unreadMessages' />
|
90
|
|
- </span>,
|
91
|
|
- id: 'toolbar_button_chat',
|
92
|
|
- onClick() {
|
93
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.chat.toggled');
|
94
|
|
- APP.UI.emitEvent(UIEvents.TOGGLE_CHAT);
|
95
|
|
- },
|
96
|
|
- shortcut: 'C',
|
97
|
|
- shortcutAttr: 'toggleChatPopover',
|
98
|
|
- shortcutFunc() {
|
99
|
|
- JitsiMeetJS.analytics.sendEvent('shortcut.chat.toggled');
|
100
|
|
- APP.UI.toggleChat();
|
101
|
|
- },
|
102
|
|
- shortcutDescription: 'keyboardShortcuts.toggleChat',
|
103
|
|
- sideContainerId: 'chat_container',
|
104
|
|
- tooltipKey: 'toolbar.chat'
|
105
|
|
- },
|
106
|
|
-
|
107
|
|
- /**
|
108
|
|
- * The descriptor of the contact list toolbar button.
|
109
|
|
- */
|
110
|
|
- contacts: {
|
111
|
|
- childComponent: ParticipantCounter,
|
112
|
|
- classNames: [ 'button', 'icon-contactList' ],
|
113
|
|
- enabled: true,
|
114
|
|
- id: 'toolbar_contact_list',
|
115
|
|
- onClick() {
|
116
|
|
- JitsiMeetJS.analytics.sendEvent(
|
117
|
|
- 'toolbar.contacts.toggled');
|
118
|
|
- APP.UI.emitEvent(UIEvents.TOGGLE_CONTACT_LIST);
|
119
|
|
- },
|
120
|
|
- sideContainerId: 'contacts_container',
|
121
|
|
- tooltipKey: 'bottomtoolbar.contactlist'
|
122
|
|
- },
|
123
|
|
-
|
124
|
|
- /**
|
125
|
|
- * The descriptor of the desktop sharing toolbar button.
|
126
|
|
- */
|
127
|
|
- desktop: {
|
128
|
|
- classNames: [ 'button', 'icon-share-desktop' ],
|
129
|
|
- enabled: true,
|
130
|
|
- id: 'toolbar_button_desktopsharing',
|
131
|
|
- onClick() {
|
132
|
|
- if (APP.conference.isSharingScreen) {
|
133
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.screen.disabled');
|
134
|
|
- } else {
|
135
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.screen.enabled');
|
136
|
|
- }
|
137
|
|
- APP.UI.emitEvent(UIEvents.TOGGLE_SCREENSHARING);
|
|
31
|
+function getDefaultButtons() {
|
|
32
|
+ if (!_.isEmpty(buttons)) {
|
|
33
|
+ return buttons;
|
|
34
|
+ }
|
|
35
|
+
|
|
36
|
+ buttons = {
|
|
37
|
+ /**
|
|
38
|
+ * The descriptor of the camera toolbar button.
|
|
39
|
+ */
|
|
40
|
+ camera: {
|
|
41
|
+ classNames: [ 'button', 'icon-camera' ],
|
|
42
|
+ enabled: true,
|
|
43
|
+ isDisplayed: () => true,
|
|
44
|
+ id: 'toolbar_button_camera',
|
|
45
|
+ onClick() {
|
|
46
|
+ const newVideoMutedState = !APP.conference.isLocalVideoMuted();
|
|
47
|
+
|
|
48
|
+ if (newVideoMutedState) {
|
|
49
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.video.enabled');
|
|
50
|
+ } else {
|
|
51
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.video.disabled');
|
|
52
|
+ }
|
|
53
|
+ APP.UI.emitEvent(UIEvents.VIDEO_MUTED, newVideoMutedState);
|
|
54
|
+ },
|
|
55
|
+ popups: [
|
|
56
|
+ {
|
|
57
|
+ dataAttr: 'audioOnly.featureToggleDisabled',
|
|
58
|
+ dataInterpolate: { feature: 'video mute' },
|
|
59
|
+ id: 'unmuteWhileAudioOnly'
|
|
60
|
+ }
|
|
61
|
+ ],
|
|
62
|
+ shortcut: 'V',
|
|
63
|
+ shortcutAttr: 'toggleVideoPopover',
|
|
64
|
+ shortcutFunc() {
|
|
65
|
+ if (APP.conference.isAudioOnly()) {
|
|
66
|
+ APP.UI.emitEvent(UIEvents.VIDEO_UNMUTING_WHILE_AUDIO_ONLY);
|
|
67
|
+
|
|
68
|
+ return;
|
|
69
|
+ }
|
|
70
|
+
|
|
71
|
+ JitsiMeetJS.analytics.sendEvent('shortcut.videomute.toggled');
|
|
72
|
+ APP.conference.toggleVideoMuted();
|
|
73
|
+ },
|
|
74
|
+ shortcutDescription: 'keyboardShortcuts.videoMute',
|
|
75
|
+ tooltipKey: 'toolbar.videomute'
|
138
|
76
|
},
|
139
|
|
- popups: [
|
140
|
|
- {
|
141
|
|
- dataAttr: 'audioOnly.featureToggleDisabled',
|
142
|
|
- dataInterpolate: { feature: 'screen sharing' },
|
143
|
|
- id: 'screenshareWhileAudioOnly'
|
144
|
|
- }
|
145
|
|
- ],
|
146
|
|
- shortcut: 'D',
|
147
|
|
- shortcutAttr: 'toggleDesktopSharingPopover',
|
148
|
|
- shortcutFunc() {
|
149
|
|
- JitsiMeetJS.analytics.sendEvent('shortcut.screen.toggled');
|
150
|
|
-
|
151
|
|
- // eslint-disable-next-line no-empty-function
|
152
|
|
- APP.conference.toggleScreenSharing().catch(() => {});
|
|
77
|
+
|
|
78
|
+ /**
|
|
79
|
+ * The descriptor of the chat toolbar button.
|
|
80
|
+ */
|
|
81
|
+ chat: {
|
|
82
|
+ classNames: [ 'button', 'icon-chat' ],
|
|
83
|
+ enabled: true,
|
|
84
|
+ html: <span className = 'badge-round'>
|
|
85
|
+ <span id = 'unreadMessages' /></span>,
|
|
86
|
+ id: 'toolbar_button_chat',
|
|
87
|
+ onClick() {
|
|
88
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.chat.toggled');
|
|
89
|
+ APP.UI.emitEvent(UIEvents.TOGGLE_CHAT);
|
|
90
|
+ },
|
|
91
|
+ shortcut: 'C',
|
|
92
|
+ shortcutAttr: 'toggleChatPopover',
|
|
93
|
+ shortcutFunc() {
|
|
94
|
+ JitsiMeetJS.analytics.sendEvent('shortcut.chat.toggled');
|
|
95
|
+ APP.UI.toggleChat();
|
|
96
|
+ },
|
|
97
|
+ shortcutDescription: 'keyboardShortcuts.toggleChat',
|
|
98
|
+ sideContainerId: 'chat_container',
|
|
99
|
+ tooltipKey: 'toolbar.chat'
|
153
|
100
|
},
|
154
|
|
- shortcutDescription: 'keyboardShortcuts.toggleScreensharing',
|
155
|
|
- tooltipKey: 'toolbar.sharescreen'
|
156
|
|
- },
|
157
|
|
-
|
158
|
|
- /**
|
159
|
|
- * The descriptor of the dial out toolbar button.
|
160
|
|
- */
|
161
|
|
- dialout: {
|
162
|
|
- classNames: [ 'button', 'icon-telephone' ],
|
163
|
|
- enabled: true,
|
164
|
|
-
|
165
|
|
- // Will be displayed once the SIP calls functionality is detected.
|
166
|
|
- hidden: true,
|
167
|
|
- id: 'toolbar_button_dial_out',
|
168
|
|
- onClick(dispatch) {
|
169
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.sip.clicked');
|
170
|
|
-
|
171
|
|
- dispatch(openDialOutDialog());
|
|
101
|
+
|
|
102
|
+ /**
|
|
103
|
+ * The descriptor of the contact list toolbar button.
|
|
104
|
+ */
|
|
105
|
+ contacts: {
|
|
106
|
+ childComponent: ParticipantCounter,
|
|
107
|
+ classNames: [ 'button', 'icon-contactList' ],
|
|
108
|
+ enabled: true,
|
|
109
|
+ id: 'toolbar_contact_list',
|
|
110
|
+ onClick() {
|
|
111
|
+ JitsiMeetJS.analytics.sendEvent(
|
|
112
|
+ 'toolbar.contacts.toggled');
|
|
113
|
+ APP.UI.emitEvent(UIEvents.TOGGLE_CONTACT_LIST);
|
|
114
|
+ },
|
|
115
|
+ sideContainerId: 'contacts_container',
|
|
116
|
+ tooltipKey: 'bottomtoolbar.contactlist'
|
172
|
117
|
},
|
173
|
|
- tooltipKey: 'dialOut.dialOut'
|
174
|
|
- },
|
175
|
|
-
|
176
|
|
- /**
|
177
|
|
- * The descriptor of the device selection toolbar button.
|
178
|
|
- */
|
179
|
|
- fodeviceselection: {
|
180
|
|
- classNames: [ 'button', 'icon-settings' ],
|
181
|
|
- enabled: true,
|
182
|
|
- isDisplayed() {
|
183
|
|
- return interfaceConfig.filmStripOnly;
|
|
118
|
+
|
|
119
|
+ /**
|
|
120
|
+ * The descriptor of the desktop sharing toolbar button.
|
|
121
|
+ */
|
|
122
|
+ desktop: {
|
|
123
|
+ classNames: [ 'button', 'icon-share-desktop' ],
|
|
124
|
+ enabled: true,
|
|
125
|
+ id: 'toolbar_button_desktopsharing',
|
|
126
|
+ onClick() {
|
|
127
|
+ if (APP.conference.isSharingScreen) {
|
|
128
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.screen.disabled');
|
|
129
|
+ } else {
|
|
130
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.screen.enabled');
|
|
131
|
+ }
|
|
132
|
+ APP.UI.emitEvent(UIEvents.TOGGLE_SCREENSHARING);
|
|
133
|
+ },
|
|
134
|
+ popups: [
|
|
135
|
+ {
|
|
136
|
+ dataAttr: 'audioOnly.featureToggleDisabled',
|
|
137
|
+ dataInterpolate: { feature: 'screen sharing' },
|
|
138
|
+ id: 'screenshareWhileAudioOnly'
|
|
139
|
+ }
|
|
140
|
+ ],
|
|
141
|
+ shortcut: 'D',
|
|
142
|
+ shortcutAttr: 'toggleDesktopSharingPopover',
|
|
143
|
+ shortcutFunc() {
|
|
144
|
+ JitsiMeetJS.analytics.sendEvent('shortcut.screen.toggled');
|
|
145
|
+
|
|
146
|
+ // eslint-disable-next-line no-empty-function
|
|
147
|
+ APP.conference.toggleScreenSharing().catch(() => {});
|
|
148
|
+ },
|
|
149
|
+ shortcutDescription: 'keyboardShortcuts.toggleScreensharing',
|
|
150
|
+ tooltipKey: 'toolbar.sharescreen'
|
184
|
151
|
},
|
185
|
|
- id: 'toolbar_button_fodeviceselection',
|
186
|
|
- onClick(dispatch) {
|
187
|
|
- JitsiMeetJS.analytics.sendEvent(
|
188
|
|
- 'toolbar.fodeviceselection.toggled');
|
189
|
152
|
|
190
|
|
- dispatch(openDeviceSelectionDialog());
|
|
153
|
+ /**
|
|
154
|
+ * The descriptor of the device selection toolbar button.
|
|
155
|
+ */
|
|
156
|
+ fodeviceselection: {
|
|
157
|
+ classNames: [ 'button', 'icon-settings' ],
|
|
158
|
+ enabled: true,
|
|
159
|
+ isDisplayed() {
|
|
160
|
+ return interfaceConfig.filmStripOnly;
|
|
161
|
+ },
|
|
162
|
+ id: 'toolbar_button_fodeviceselection',
|
|
163
|
+ onClick(dispatch: Function) {
|
|
164
|
+ JitsiMeetJS.analytics.sendEvent(
|
|
165
|
+ 'toolbar.fodeviceselection.toggled');
|
|
166
|
+
|
|
167
|
+ dispatch(openDeviceSelectionDialog());
|
|
168
|
+ },
|
|
169
|
+ sideContainerId: 'settings_container',
|
|
170
|
+ tooltipKey: 'toolbar.Settings'
|
191
|
171
|
},
|
192
|
|
- sideContainerId: 'settings_container',
|
193
|
|
- tooltipKey: 'toolbar.Settings'
|
194
|
|
- },
|
195
|
|
-
|
196
|
|
- /**
|
197
|
|
- * The descriptor of the dialpad toolbar button.
|
198
|
|
- */
|
199
|
|
- dialpad: {
|
200
|
|
- classNames: [ 'button', 'icon-dialpad' ],
|
201
|
|
- enabled: true,
|
202
|
|
-
|
203
|
|
- // TODO: remove it after UI.updateDTMFSupport fix
|
204
|
|
- hidden: true,
|
205
|
|
- id: 'toolbar_button_dialpad',
|
206
|
|
- onClick() {
|
207
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.sip.dialpad.clicked');
|
|
172
|
+
|
|
173
|
+ /**
|
|
174
|
+ * The descriptor of the dialpad toolbar button.
|
|
175
|
+ */
|
|
176
|
+ dialpad: {
|
|
177
|
+ classNames: [ 'button', 'icon-dialpad' ],
|
|
178
|
+ enabled: true,
|
|
179
|
+
|
|
180
|
+ // TODO: remove it after UI.updateDTMFSupport fix
|
|
181
|
+ hidden: true,
|
|
182
|
+ id: 'toolbar_button_dialpad',
|
|
183
|
+ onClick() {
|
|
184
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.sip.dialpad.clicked');
|
|
185
|
+ },
|
|
186
|
+ tooltipKey: 'toolbar.dialpad'
|
208
|
187
|
},
|
209
|
|
- tooltipKey: 'toolbar.dialpad'
|
210
|
|
- },
|
211
|
|
-
|
212
|
|
- /**
|
213
|
|
- * The descriptor of the etherpad toolbar button.
|
214
|
|
- */
|
215
|
|
- etherpad: {
|
216
|
|
- classNames: [ 'button', 'icon-share-doc' ],
|
217
|
|
- enabled: true,
|
218
|
|
- hidden: true,
|
219
|
|
- id: 'toolbar_button_etherpad',
|
220
|
|
- onClick() {
|
221
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.etherpad.clicked');
|
222
|
|
- APP.UI.emitEvent(UIEvents.ETHERPAD_CLICKED);
|
|
188
|
+
|
|
189
|
+ /**
|
|
190
|
+ * The descriptor of the etherpad toolbar button.
|
|
191
|
+ */
|
|
192
|
+ etherpad: {
|
|
193
|
+ classNames: [ 'button', 'icon-share-doc' ],
|
|
194
|
+ enabled: true,
|
|
195
|
+ hidden: true,
|
|
196
|
+ id: 'toolbar_button_etherpad',
|
|
197
|
+ onClick() {
|
|
198
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.etherpad.clicked');
|
|
199
|
+ APP.UI.emitEvent(UIEvents.ETHERPAD_CLICKED);
|
|
200
|
+ },
|
|
201
|
+ tooltipKey: 'toolbar.etherpad'
|
223
|
202
|
},
|
224
|
|
- tooltipKey: 'toolbar.etherpad'
|
225
|
|
- },
|
226
|
|
-
|
227
|
|
- /**
|
228
|
|
- * The descriptor of the toolbar button which toggles full-screen mode.
|
229
|
|
- */
|
230
|
|
- fullscreen: {
|
231
|
|
- classNames: [ 'button', 'icon-full-screen' ],
|
232
|
|
- enabled: true,
|
233
|
|
- id: 'toolbar_button_fullScreen',
|
234
|
|
- onClick() {
|
235
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.fullscreen.enabled');
|
236
|
|
-
|
237
|
|
- APP.UI.emitEvent(UIEvents.TOGGLE_FULLSCREEN);
|
|
203
|
+
|
|
204
|
+ /**
|
|
205
|
+ * The descriptor of the toolbar button which toggles full-screen mode.
|
|
206
|
+ */
|
|
207
|
+ fullscreen: {
|
|
208
|
+ classNames: [ 'button', 'icon-full-screen' ],
|
|
209
|
+ enabled: true,
|
|
210
|
+ id: 'toolbar_button_fullScreen',
|
|
211
|
+ onClick() {
|
|
212
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.fullscreen.enabled');
|
|
213
|
+
|
|
214
|
+ APP.UI.emitEvent(UIEvents.TOGGLE_FULLSCREEN);
|
|
215
|
+ },
|
|
216
|
+ shortcut: 'S',
|
|
217
|
+ shortcutAttr: 'toggleFullscreenPopover',
|
|
218
|
+ shortcutDescription: 'keyboardShortcuts.fullScreen',
|
|
219
|
+ shortcutFunc() {
|
|
220
|
+ JitsiMeetJS.analytics.sendEvent('shortcut.fullscreen.toggled');
|
|
221
|
+ APP.UI.toggleFullScreen();
|
|
222
|
+ },
|
|
223
|
+ tooltipKey: 'toolbar.fullscreen'
|
238
|
224
|
},
|
239
|
|
- shortcut: 'S',
|
240
|
|
- shortcutAttr: 'toggleFullscreenPopover',
|
241
|
|
- shortcutDescription: 'keyboardShortcuts.fullScreen',
|
242
|
|
- shortcutFunc() {
|
243
|
|
- JitsiMeetJS.analytics.sendEvent('shortcut.fullscreen.toggled');
|
244
|
|
- APP.UI.toggleFullScreen();
|
|
225
|
+
|
|
226
|
+ /**
|
|
227
|
+ * The descriptor of the toolbar button which hangs up the
|
|
228
|
+ * call/conference.
|
|
229
|
+ */
|
|
230
|
+ hangup: {
|
|
231
|
+ classNames: [ 'button', 'icon-hangup', 'button_hangup' ],
|
|
232
|
+ enabled: true,
|
|
233
|
+ isDisplayed: () => true,
|
|
234
|
+ id: 'toolbar_button_hangup',
|
|
235
|
+ onClick() {
|
|
236
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.hangup');
|
|
237
|
+ APP.UI.emitEvent(UIEvents.HANGUP);
|
|
238
|
+ },
|
|
239
|
+ tooltipKey: 'toolbar.hangup'
|
245
|
240
|
},
|
246
|
|
- tooltipKey: 'toolbar.fullscreen'
|
247
|
|
- },
|
248
|
|
-
|
249
|
|
- /**
|
250
|
|
- * The descriptor of the toolbar button which hangs up the call/conference.
|
251
|
|
- */
|
252
|
|
- hangup: {
|
253
|
|
- classNames: [ 'button', 'icon-hangup', 'button_hangup' ],
|
254
|
|
- enabled: true,
|
255
|
|
- isDisplayed: () => true,
|
256
|
|
- id: 'toolbar_button_hangup',
|
257
|
|
- onClick() {
|
258
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.hangup');
|
259
|
|
- APP.UI.emitEvent(UIEvents.HANGUP);
|
|
241
|
+
|
|
242
|
+ /**
|
|
243
|
+ * The descriptor of the toolbar button which opens a dialog for the
|
|
244
|
+ * conference URL and inviting others.
|
|
245
|
+ */
|
|
246
|
+ info: {
|
|
247
|
+ component: InfoDialogButton
|
260
|
248
|
},
|
261
|
|
- tooltipKey: 'toolbar.hangup'
|
262
|
|
- },
|
263
|
|
-
|
264
|
|
- /**
|
265
|
|
- * The descriptor of the toolbar button which opens a dialog for the
|
266
|
|
- * conference URL and inviting others.
|
267
|
|
- */
|
268
|
|
- info: {
|
269
|
|
- component: InfoDialogButton
|
270
|
|
- },
|
271
|
|
-
|
272
|
|
- /**
|
273
|
|
- * The descriptor of the toolbar button which shows the invite user dialog.
|
274
|
|
- */
|
275
|
|
- invite: {
|
276
|
|
- classNames: [ 'button', 'icon-link' ],
|
277
|
|
- enabled: true,
|
278
|
|
- id: 'toolbar_button_link',
|
279
|
|
- onClick(dispatch) {
|
280
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.invite.clicked');
|
281
|
|
-
|
282
|
|
- dispatch(openInviteDialog());
|
|
249
|
+
|
|
250
|
+ /**
|
|
251
|
+ * The descriptor of the toolbar button which shows the invite user
|
|
252
|
+ * dialog.
|
|
253
|
+ */
|
|
254
|
+ invite: {
|
|
255
|
+ classNames: [ 'button', 'icon-link' ],
|
|
256
|
+ enabled: true,
|
|
257
|
+ id: 'toolbar_button_link',
|
|
258
|
+ onClick(dispatch: Function) {
|
|
259
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.invite.clicked');
|
|
260
|
+
|
|
261
|
+ dispatch(openInviteDialog());
|
|
262
|
+ },
|
|
263
|
+ tooltipKey: 'toolbar.invite'
|
283
|
264
|
},
|
284
|
|
- tooltipKey: 'toolbar.invite'
|
285
|
|
- },
|
286
|
|
-
|
287
|
|
- /**
|
288
|
|
- * The descriptor of the microphone toolbar button.
|
289
|
|
- */
|
290
|
|
- microphone: {
|
291
|
|
- classNames: [ 'button', 'icon-microphone' ],
|
292
|
|
- enabled: true,
|
293
|
|
- isDisplayed: () => true,
|
294
|
|
- id: 'toolbar_button_mute',
|
295
|
|
- onClick() {
|
296
|
|
- const sharedVideoManager = APP.UI.getSharedVideoManager();
|
297
|
|
-
|
298
|
|
- if (APP.conference.isLocalAudioMuted()) {
|
299
|
|
- // If there's a shared video with the volume "on" and we aren't
|
300
|
|
- // the video owner, we warn the user
|
301
|
|
- // that currently it's not possible to unmute.
|
302
|
|
- if (sharedVideoManager
|
303
|
|
- && sharedVideoManager.isSharedVideoVolumeOn()
|
304
|
|
- && !sharedVideoManager.isSharedVideoOwner()) {
|
305
|
|
- APP.UI.showCustomToolbarPopup(
|
306
|
|
- '#unableToUnmutePopup', true, 5000);
|
|
265
|
+
|
|
266
|
+ /**
|
|
267
|
+ * The descriptor of the microphone toolbar button.
|
|
268
|
+ */
|
|
269
|
+ microphone: {
|
|
270
|
+ classNames: [ 'button', 'icon-microphone' ],
|
|
271
|
+ enabled: true,
|
|
272
|
+ isDisplayed: () => true,
|
|
273
|
+ id: 'toolbar_button_mute',
|
|
274
|
+ onClick() {
|
|
275
|
+ const sharedVideoManager = APP.UI.getSharedVideoManager();
|
|
276
|
+
|
|
277
|
+ if (APP.conference.isLocalAudioMuted()) {
|
|
278
|
+ // If there's a shared video with the volume "on" and we
|
|
279
|
+ // aren't the video owner, we warn the user
|
|
280
|
+ // that currently it's not possible to unmute.
|
|
281
|
+ if (sharedVideoManager
|
|
282
|
+ && sharedVideoManager.isSharedVideoVolumeOn()
|
|
283
|
+ && !sharedVideoManager.isSharedVideoOwner()) {
|
|
284
|
+ APP.UI.showCustomToolbarPopup(
|
|
285
|
+ '#unableToUnmutePopup', true, 5000);
|
|
286
|
+ } else {
|
|
287
|
+ JitsiMeetJS.analytics
|
|
288
|
+ .sendEvent('toolbar.audio.unmuted');
|
|
289
|
+ APP.UI.emitEvent(UIEvents.AUDIO_MUTED, false, true);
|
|
290
|
+ }
|
307
|
291
|
} else {
|
308
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.audio.unmuted');
|
309
|
|
- APP.UI.emitEvent(UIEvents.AUDIO_MUTED, false, true);
|
|
292
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.audio.muted');
|
|
293
|
+ APP.UI.emitEvent(UIEvents.AUDIO_MUTED, true, true);
|
310
|
294
|
}
|
311
|
|
- } else {
|
312
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.audio.muted');
|
313
|
|
- APP.UI.emitEvent(UIEvents.AUDIO_MUTED, true, true);
|
314
|
|
- }
|
315
|
|
- },
|
316
|
|
- popups: [
|
317
|
|
- {
|
318
|
|
- dataAttr: 'toolbar.micMutedPopup',
|
319
|
|
- id: 'micMutedPopup'
|
320
|
295
|
},
|
321
|
|
- {
|
322
|
|
- dataAttr: 'toolbar.unableToUnmutePopup',
|
323
|
|
- id: 'unableToUnmutePopup'
|
|
296
|
+ popups: [
|
|
297
|
+ {
|
|
298
|
+ dataAttr: 'toolbar.micMutedPopup',
|
|
299
|
+ id: 'micMutedPopup'
|
|
300
|
+ },
|
|
301
|
+ {
|
|
302
|
+ dataAttr: 'toolbar.unableToUnmutePopup',
|
|
303
|
+ id: 'unableToUnmutePopup'
|
|
304
|
+ },
|
|
305
|
+ {
|
|
306
|
+ dataAttr: 'toolbar.talkWhileMutedPopup',
|
|
307
|
+ id: 'talkWhileMutedPopup'
|
|
308
|
+ }
|
|
309
|
+ ],
|
|
310
|
+ shortcut: 'M',
|
|
311
|
+ shortcutAttr: 'mutePopover',
|
|
312
|
+ shortcutFunc() {
|
|
313
|
+ JitsiMeetJS.analytics.sendEvent('shortcut.audiomute.toggled');
|
|
314
|
+ APP.conference.toggleAudioMuted();
|
324
|
315
|
},
|
325
|
|
- {
|
326
|
|
- dataAttr: 'toolbar.talkWhileMutedPopup',
|
327
|
|
- id: 'talkWhileMutedPopup'
|
328
|
|
- }
|
329
|
|
- ],
|
330
|
|
- shortcut: 'M',
|
331
|
|
- shortcutAttr: 'mutePopover',
|
332
|
|
- shortcutFunc() {
|
333
|
|
- JitsiMeetJS.analytics.sendEvent('shortcut.audiomute.toggled');
|
334
|
|
- APP.conference.toggleAudioMuted();
|
|
316
|
+ shortcutDescription: 'keyboardShortcuts.mute',
|
|
317
|
+ tooltipKey: 'toolbar.mute'
|
335
|
318
|
},
|
336
|
|
- shortcutDescription: 'keyboardShortcuts.mute',
|
337
|
|
- tooltipKey: 'toolbar.mute'
|
338
|
|
- },
|
339
|
|
-
|
340
|
|
- /**
|
341
|
|
- * The descriptor of the profile toolbar button.
|
342
|
|
- */
|
343
|
|
- profile: {
|
344
|
|
- component: ProfileButton,
|
345
|
|
- sideContainerId: 'profile_container'
|
346
|
|
- },
|
347
|
|
-
|
348
|
|
- /**
|
349
|
|
- * The descriptor of the "Raise hand" toolbar button.
|
350
|
|
- */
|
351
|
|
- raisehand: {
|
352
|
|
- classNames: [ 'button', 'icon-raised-hand' ],
|
353
|
|
- enabled: true,
|
354
|
|
- id: 'toolbar_button_raisehand',
|
355
|
|
- onClick() {
|
356
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.raiseHand.clicked');
|
357
|
|
- APP.conference.maybeToggleRaisedHand();
|
|
319
|
+
|
|
320
|
+ /**
|
|
321
|
+ * The descriptor of the profile toolbar button.
|
|
322
|
+ */
|
|
323
|
+ profile: {
|
|
324
|
+ component: ProfileButton,
|
|
325
|
+ sideContainerId: 'profile_container'
|
358
|
326
|
},
|
359
|
|
- shortcut: 'R',
|
360
|
|
- shortcutAttr: 'raiseHandPopover',
|
361
|
|
- shortcutDescription: 'keyboardShortcuts.raiseHand',
|
362
|
|
- shortcutFunc() {
|
363
|
|
- JitsiMeetJS.analytics.sendEvent('shortcut.raisehand.clicked');
|
364
|
|
- APP.conference.maybeToggleRaisedHand();
|
|
327
|
+
|
|
328
|
+ /**
|
|
329
|
+ * The descriptor of the "Raise hand" toolbar button.
|
|
330
|
+ */
|
|
331
|
+ raisehand: {
|
|
332
|
+ classNames: [ 'button', 'icon-raised-hand' ],
|
|
333
|
+ enabled: true,
|
|
334
|
+ id: 'toolbar_button_raisehand',
|
|
335
|
+ onClick() {
|
|
336
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.raiseHand.clicked');
|
|
337
|
+ APP.conference.maybeToggleRaisedHand();
|
|
338
|
+ },
|
|
339
|
+ shortcut: 'R',
|
|
340
|
+ shortcutAttr: 'raiseHandPopover',
|
|
341
|
+ shortcutDescription: 'keyboardShortcuts.raiseHand',
|
|
342
|
+ shortcutFunc() {
|
|
343
|
+ JitsiMeetJS.analytics.sendEvent('shortcut.raisehand.clicked');
|
|
344
|
+ APP.conference.maybeToggleRaisedHand();
|
|
345
|
+ },
|
|
346
|
+ tooltipKey: 'toolbar.raiseHand'
|
365
|
347
|
},
|
366
|
|
- tooltipKey: 'toolbar.raiseHand'
|
367
|
|
- },
|
368
|
|
-
|
369
|
|
- /**
|
370
|
|
- * The descriptor of the recording toolbar button. Requires additional
|
371
|
|
- * initialization in the recording module.
|
372
|
|
- */
|
373
|
|
- recording: {
|
374
|
|
- classNames: [ 'button' ],
|
375
|
|
- enabled: true,
|
376
|
|
-
|
377
|
|
- // will be displayed once the recording functionality is detected
|
378
|
|
- hidden: true,
|
379
|
|
- id: 'toolbar_button_record',
|
380
|
|
- tooltipKey: 'liveStreaming.buttonTooltip'
|
381
|
|
- },
|
382
|
|
-
|
383
|
|
- /**
|
384
|
|
- * The descriptor of the settings toolbar button.
|
385
|
|
- */
|
386
|
|
- settings: {
|
387
|
|
- classNames: [ 'button', 'icon-settings' ],
|
388
|
|
- enabled: true,
|
389
|
|
- id: 'toolbar_button_settings',
|
390
|
|
- onClick() {
|
391
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.settings.toggled');
|
392
|
|
- APP.UI.emitEvent(UIEvents.TOGGLE_SETTINGS);
|
|
348
|
+
|
|
349
|
+ /**
|
|
350
|
+ * The descriptor of the recording toolbar button. Requires additional
|
|
351
|
+ * initialization in the recording module.
|
|
352
|
+ */
|
|
353
|
+ recording: {
|
|
354
|
+ classNames: [ 'button' ],
|
|
355
|
+ enabled: true,
|
|
356
|
+
|
|
357
|
+ // will be displayed once the recording functionality is detected
|
|
358
|
+ hidden: true,
|
|
359
|
+ id: 'toolbar_button_record',
|
|
360
|
+ tooltipKey: 'liveStreaming.buttonTooltip'
|
393
|
361
|
},
|
394
|
|
- sideContainerId: 'settings_container',
|
395
|
|
- tooltipKey: 'toolbar.Settings'
|
396
|
|
- },
|
397
|
|
-
|
398
|
|
- /**
|
399
|
|
- * The descriptor of the "Share YouTube video" toolbar button.
|
400
|
|
- */
|
401
|
|
- sharedvideo: {
|
402
|
|
- classNames: [ 'button', 'icon-shared-video' ],
|
403
|
|
- enabled: true,
|
404
|
|
- id: 'toolbar_button_sharedvideo',
|
405
|
|
- onClick() {
|
406
|
|
- JitsiMeetJS.analytics.sendEvent('toolbar.sharedvideo.clicked');
|
407
|
|
- APP.UI.emitEvent(UIEvents.SHARED_VIDEO_CLICKED);
|
|
362
|
+
|
|
363
|
+ /**
|
|
364
|
+ * The descriptor of the settings toolbar button.
|
|
365
|
+ */
|
|
366
|
+ settings: {
|
|
367
|
+ classNames: [ 'button', 'icon-settings' ],
|
|
368
|
+ enabled: true,
|
|
369
|
+ id: 'toolbar_button_settings',
|
|
370
|
+ onClick() {
|
|
371
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.settings.toggled');
|
|
372
|
+ APP.UI.emitEvent(UIEvents.TOGGLE_SETTINGS);
|
|
373
|
+ },
|
|
374
|
+ sideContainerId: 'settings_container',
|
|
375
|
+ tooltipKey: 'toolbar.Settings'
|
408
|
376
|
},
|
409
|
|
- popups: [
|
410
|
|
- {
|
411
|
|
- dataAttr: 'toolbar.sharedVideoMutedPopup',
|
412
|
|
- id: 'sharedVideoMutedPopup'
|
413
|
|
- }
|
414
|
|
- ],
|
415
|
|
- tooltipKey: 'toolbar.sharedvideo'
|
416
|
|
- },
|
417
|
|
-
|
418
|
|
- videoquality: {
|
419
|
|
- component: VideoQualityButton
|
420
|
|
- }
|
421
|
|
-};
|
422
|
377
|
|
|
378
|
+ /**
|
|
379
|
+ * The descriptor of the "Share YouTube video" toolbar button.
|
|
380
|
+ */
|
|
381
|
+ sharedvideo: {
|
|
382
|
+ classNames: [ 'button', 'icon-shared-video' ],
|
|
383
|
+ enabled: true,
|
|
384
|
+ id: 'toolbar_button_sharedvideo',
|
|
385
|
+ onClick() {
|
|
386
|
+ JitsiMeetJS.analytics.sendEvent('toolbar.sharedvideo.clicked');
|
|
387
|
+ APP.UI.emitEvent(UIEvents.SHARED_VIDEO_CLICKED);
|
|
388
|
+ },
|
|
389
|
+ popups: [
|
|
390
|
+ {
|
|
391
|
+ dataAttr: 'toolbar.sharedVideoMutedPopup',
|
|
392
|
+ id: 'sharedVideoMutedPopup'
|
|
393
|
+ }
|
|
394
|
+ ],
|
|
395
|
+ tooltipKey: 'toolbar.sharedvideo'
|
|
396
|
+ },
|
423
|
397
|
|
424
|
|
-Object.keys(buttons).forEach(name => {
|
425
|
|
- const button = buttons[name];
|
|
398
|
+ videoquality: {
|
|
399
|
+ component: VideoQualityButton
|
|
400
|
+ }
|
|
401
|
+ };
|
426
|
402
|
|
427
|
|
- if (!button.isDisplayed) {
|
428
|
|
- button.isDisplayed = () => !interfaceConfig.filmStripOnly;
|
429
|
|
- }
|
430
|
|
-});
|
|
403
|
+ Object.keys(buttons).forEach(name => {
|
|
404
|
+ const button = buttons[name];
|
|
405
|
+
|
|
406
|
+ if (!button.isDisplayed) {
|
|
407
|
+ button.isDisplayed = () => !interfaceConfig.filmStripOnly;
|
|
408
|
+ }
|
|
409
|
+ });
|
|
410
|
+
|
|
411
|
+ return buttons;
|
|
412
|
+}
|
431
|
413
|
|
432
|
|
-export default buttons;
|
|
414
|
+export default getDefaultButtons;
|