diff --git a/demo/index.html b/demo/index.html
index 43415cf0..3d6d4981 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -67,7 +67,7 @@
+
+
Choose what you'd like to share
+
+
+
+ No screens or applications are currently available.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/enums/api.js b/js/enums/api.js
index c6941e43..16fda17d 100644
--- a/js/enums/api.js
+++ b/js/enums/api.js
@@ -17,7 +17,8 @@ const cmds = keyMirror({
registerActivityDetection: null,
showNotificationSettings: null,
sanitize: null,
- bringToFront: null
+ bringToFront: null,
+ openScreenPickerWindow: null
});
module.exports = {
diff --git a/js/mainApiMgr.js b/js/mainApiMgr.js
index 98bfbf32..f7349a9c 100644
--- a/js/mainApiMgr.js
+++ b/js/mainApiMgr.js
@@ -16,6 +16,7 @@ const configureNotification = require('./notify/settings/configure-notification-
const { bringToFront } = require('./bringToFront.js');
const eventEmitter = require('./eventEmitter');
const { isMac } = require('./utils/misc');
+const { openScreenPickerWindow } = require('./desktopCapturer');
const apiEnums = require('./enums/api.js');
const apiCmds = apiEnums.cmds;
@@ -135,6 +136,11 @@ electron.ipcMain.on(apiName, (event, arg) => {
bringToFront(arg.windowName, arg.reason);
}
break;
+ case apiCmds.openScreenPickerWindow:
+ if (Array.isArray(arg.sources) && typeof arg.id === 'number') {
+ openScreenPickerWindow(event.sender, arg.sources, arg.id);
+ }
+ break;
default:
}
diff --git a/js/preload/preloadMain.js b/js/preload/preloadMain.js
index 84700a9d..8beba256 100644
--- a/js/preload/preloadMain.js
+++ b/js/preload/preloadMain.js
@@ -18,6 +18,7 @@ const apiEnums = require('../enums/api.js');
const apiCmds = apiEnums.cmds;
const apiName = apiEnums.apiName;
const getMediaSources = require('../desktopCapturer/getSources');
+const getMediaSource = require('../desktopCapturer/getSource');
require('../downloadManager');
@@ -260,9 +261,22 @@ function createAPI() {
* a sandboxed renderer process.
* see: https://electron.atom.io/docs/api/desktop-capturer/
* for interface: see documentation in desktopCapturer/getSources.js
+ *
+ * @deprecated instead use getMediaSource
*/
getMediaSources: getMediaSources,
+ /**
+ * Implements equivalent of desktopCapturer.getSources - that works in
+ * a sandboxed renderer process.
+ * see: https://electron.atom.io/docs/api/desktop-capturer/
+ * for interface: see documentation in desktopCapturer/getSource.js
+ *
+ * This opens a window and displays all the desktop sources
+ * and returns selected source
+ */
+ getMediaSource: getMediaSource,
+
/**
* Opens a modal window to configure notification preference.
*/