From d4b50523c2f82ce98b65d763a478956938bc8bc9 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 27 Nov 2019 12:55:44 -0500 Subject: [PATCH 1/3] DEV-2832: Automatically minimize Screen Share app when sharing window is confirmed --- screenshare/src/screenshareApp.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/screenshare/src/screenshareApp.js b/screenshare/src/screenshareApp.js index 2abc151988..4de36639dc 100644 --- a/screenshare/src/screenshareApp.js +++ b/screenshare/src/screenshareApp.js @@ -7,6 +7,8 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +const { remote } = require('electron'); + // Helpers function handleError(error) { if (error) { @@ -221,6 +223,7 @@ function onAccessApproved(desktop_id) { } } }, gotStream, handleError); + remote.getCurrentWindow().minimize(); } From 5eae6711e6a5d9f5fc20b5a9b6e0736706be2821 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 27 Nov 2019 13:01:41 -0500 Subject: [PATCH 2/3] Resolve DEV-2816 while I'm at it - allow users to switch between screens --- screenshare/src/screenshareApp.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/screenshare/src/screenshareApp.js b/screenshare/src/screenshareApp.js index 4de36639dc..1cdc392fb6 100644 --- a/screenshare/src/screenshareApp.js +++ b/screenshare/src/screenshareApp.js @@ -190,6 +190,10 @@ function stopSharing() { // Callback to start publishing after we have setup the chromium stream function gotStream(stream) { + if (localStream) { + stopSharing(); + } + localStream = stream; startTokboxPublisher(localStream); @@ -208,6 +212,9 @@ function onAccessApproved(desktop_id) { console.log('Desktop Capture access rejected.'); return; } + + + document.getElementById('screenshare').style.visibility = "block"; desktopSharing = true; navigator.webkitGetUserMedia({ From 327508aa0d51ca2509613e94450740acca4bdde6 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 27 Nov 2019 13:56:55 -0500 Subject: [PATCH 3/3] Prevent video dropout with audioFallbackEnabled set to false --- screenshare/src/screenshareApp.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/screenshare/src/screenshareApp.js b/screenshare/src/screenshareApp.js index 1cdc392fb6..b16f5ca993 100644 --- a/screenshare/src/screenshareApp.js +++ b/screenshare/src/screenshareApp.js @@ -258,11 +258,15 @@ var publisher; function startTokboxPublisher(stream) { publisher = document.createElement("div"); var publisherOptions = { - videoSource: stream.getVideoTracks()[0], + audioFallbackEnabled: false, audioSource: null, + fitMode: 'contain', + frameRate: 30, + height: 720, insertMode: 'append', - width: 1280, - height: 720 + publishAudio: false, + videoSource: stream.getVideoTracks()[0], + width: 1280 }; publisher = OT.initPublisher(publisher, publisherOptions, function(error){