|
@@ -116,9 +116,19 @@ function initCommands() {
|
116
|
116
|
sendAnalytics(createApiEvent('chat.toggled'));
|
117
|
117
|
APP.UI.toggleChat();
|
118
|
118
|
},
|
119
|
|
- 'toggle-share-screen': () => {
|
|
119
|
+
|
|
120
|
+ /**
|
|
121
|
+ * Callback to invoke when the "toggle-share-screen" command is received.
|
|
122
|
+ *
|
|
123
|
+ * @param {Object} options - Additional details of how to perform
|
|
124
|
+ * the action. Note this parameter is undocumented and experimental.
|
|
125
|
+ * @param {boolean} options.enable - Whether trying to enable screen
|
|
126
|
+ * sharing or to turn it off.
|
|
127
|
+ * @returns {void}
|
|
128
|
+ */
|
|
129
|
+ 'toggle-share-screen': (options = {}) => {
|
120
|
130
|
sendAnalytics(createApiEvent('screen.sharing.toggled'));
|
121
|
|
- toggleScreenSharing();
|
|
131
|
+ toggleScreenSharing(options.enable);
|
122
|
132
|
},
|
123
|
133
|
'toggle-tile-view': () => {
|
124
|
134
|
sendAnalytics(createApiEvent('tile-view.toggled'));
|
|
@@ -242,13 +252,17 @@ function shouldBeEnabled() {
|
242
|
252
|
/**
|
243
|
253
|
* Executes on toggle-share-screen command.
|
244
|
254
|
*
|
|
255
|
+ * @param {boolean} [enable] - Whether this toggle is to explicitly enable or
|
|
256
|
+ * disable screensharing. If not defined, the application will automatically
|
|
257
|
+ * attempt to toggle between enabled and disabled. This boolean is useful for
|
|
258
|
+ * explicitly setting desired screensharing state.
|
245
|
259
|
* @returns {void}
|
246
|
260
|
*/
|
247
|
|
-function toggleScreenSharing() {
|
|
261
|
+function toggleScreenSharing(enable) {
|
248
|
262
|
if (APP.conference.isDesktopSharingEnabled) {
|
249
|
263
|
|
250
|
264
|
// eslint-disable-next-line no-empty-function
|
251
|
|
- APP.conference.toggleScreenSharing().catch(() => {});
|
|
265
|
+ APP.conference.toggleScreenSharing(enable).catch(() => {});
|
252
|
266
|
} else {
|
253
|
267
|
initialScreenSharingState = !initialScreenSharingState;
|
254
|
268
|
}
|