bloodymary/app/discord_native/renderer/desktopCapture.js
2020-08-07 18:43:18 +00:00

21 lines
No EOL
457 B
JavaScript

'use strict';
const electron = require('electron');
function getDesktopCaptureSources(options) {
return new Promise((resolve, reject) => {
electron.desktopCapturer.getSources(options).then(sources => {
return resolve(sources.map(source => {
return {
id: source.id,
name: source.name,
url: source.thumbnail.toDataURL()
};
}));
});
});
}
module.exports = {
getDesktopCaptureSources
};