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?

Thanks!

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 {
	setupScreenSharingRender
} = require("jitsi-meet-electron-utils");
let hook = setupScreenSharingRender(api);

function reinstantiateScreenSharing() {
	hook._onIframeApiLoad();
}