mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 05:29:58 +01:00
Merge pull request #161 from SimonBrandner/fix-screen-sharing
Fix desktop Matrix screen sharing
This commit is contained in:
commit
8828838e8a
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
const { contextBridge, ipcRenderer } = require("electron");
|
||||
const { ipcRenderer, desktopCapturer, contextBridge } = require('electron');
|
||||
|
||||
// Expose only expected IPC wrapper APIs to the renderer process to avoid
|
||||
// handing out generalised messaging access.
|
||||
@ -53,5 +53,19 @@ contextBridge.exposeInMainWorld(
|
||||
}
|
||||
ipcRenderer.send(channel, ...args);
|
||||
},
|
||||
async getDesktopCapturerSources(options) {
|
||||
const sources = await desktopCapturer.getSources(options);
|
||||
const desktopCapturerSources = [];
|
||||
|
||||
for (const source of sources) {
|
||||
desktopCapturerSources.push({
|
||||
id: source.id,
|
||||
name: source.name,
|
||||
thumbnailURL: source.thumbnail.toDataURL(),
|
||||
});
|
||||
}
|
||||
|
||||
return desktopCapturerSources;
|
||||
},
|
||||
},
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user