Electron loadURL ScreenSharing

Hello everyone,

I have an Electron project with uses loadURL to load a custom Jitsi installed in my server, when I use that Jitsi from the web everything is ok but from Electron the screensharing does not work. I have the following error: Uncaught (in promise) Error: Called JitsiMeetElectron.obtainDesktopStreams but it is not defined

I’ve been checking jitsi-meet-electron-utils and jitsi-electron but I don’t get the error fixed, for sure I’m missing something, at this point for doing a simple poc I have the following:

  • Basic Electron (v7.2.2) implementation which uses loadURL to load https://meet.jit.si/conference-to-test*
  • In the main.js of electron I use setupScreenSharingMain(mainWindow, appName, osxBundleId); like in the example on the repo.

*I’m trying with the official meet.jitsi in order to test the simplest case scenario posible.

I assume the utils project is the key to solve this issue, what I’m missing?


I have the same issue. It happens when the Electron app does not load a Jitsi conference directly (“roomName” option in IFrame API) but displays the start page first where the user can type in a room name and then redirects. It works, however, when the app loads a room directly. Did you find a solution?

I found a workaround. For some reason, after the redirect the _onIframeApiLoad method isn’t called again, even though it should. So this will work in the renderer:

const domain = 'meet.example.com';
const options = {
	onload: reinstantiateScreenSharing
const api = new JitsiMeetExternalAPI(domain, options);
const {
} = require("jitsi-meet-electron-utils");
let hook = setupScreenSharingRender(api);

function reinstantiateScreenSharing() {
1 Like

You’re talking about the renderer so I assume you have the Jitsi application available on the Electron project right? In my case in the Electron project I only have the main.js which calls my custom Jitsi Meet project through loadURL, so I think I can’t apply your workaround in my case scenario :frowning:

I’m right or you have the same configuration of projects than me? Thanks!

I also display an externally-hosted Jitsi instance in my Electron app but I don’t use loadURL but the Jitsi Meet iFrame API in combination with Jitsi Meet Electron Utils. The latter provides a way to show a screen/window selector for screen sharing but I had to apply the hack shown above to make it work properly. Maybe they have fixed this problem in the most recent version. It’s worth a try.

1 Like

Thanks for you quick response! :+1: