From 74c420a609a7a7a88db53150247d69cd7f8bd94a Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 13 Nov 2015 16:18:22 -0600 Subject: [PATCH] Adds config option for auto enable desktop sharing when opening an url. --- modules/UI/UI.js | 2 ++ modules/UI/toolbars/Toolbar.js | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 3bf7c3dda..637256394 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -528,6 +528,8 @@ function onMucJoined(jid, info) { VideoLayout.mucJoined(); + + Toolbar.checkAutoEnableDesktopSharing(); } function initEtherpad(name) { diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index 9f229ddfd..03949b09f 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -632,13 +632,23 @@ var Toolbar = (function (my) { } }; - // checks whether recording is enabled and whether we have params to start automatically recording + // checks whether recording is enabled and whether we have params + // to start automatically recording my.checkAutoRecord = function () { if (UIUtil.isButtonEnabled('recording') && config.autoRecord) { toggleRecording(config.autoRecordToken); } }; + // checks whether desktop sharing is enabled and whether + // we have params to start automatically sharing + my.checkAutoEnableDesktopSharing = function () { + if (UIUtil.isButtonEnabled('desktop') + && config.autoEnableDesktopSharing) { + APP.desktopsharing.toggleScreenSharing(); + } + }; + // Shows or hides SIP calls button my.showSipCallButton = function (show) { if (APP.xmpp.isSipGatewayEnabled() && UIUtil.isButtonEnabled('sip') && show) {