diff --git a/screensharing/main.js b/screensharing/main.js index f06f6300..70c17c3e 100644 --- a/screensharing/main.js +++ b/screensharing/main.js @@ -96,6 +96,7 @@ class ScreenShareMainHook { }); this._screenShareTracker.sharingIdentity = this._identity; + // eslint-disable-next-line no-undef this._screenShareTracker.loadURL(`file://${__dirname}/screenSharingTracker.html?`); } } diff --git a/screensharing/render.js b/screensharing/render.js index 664131cb..8eff77b2 100644 --- a/screensharing/render.js +++ b/screensharing/render.js @@ -15,11 +15,14 @@ class ScreenShareRenderHook { /** * Creates a ScreenShareRenderHook hooked to jitsi meet iframe events. * + * @param {iframe} iframe - The jitsi Meet iframe object. This may seem redundant as we can access it from + * the api object, however we need it here for backwards compatibility as some clients are setup is such a + * way that they may end up calling the old jitsi-meet-electron-utils with the updated api, causing crashes. * @param {JitsiIFrameApi} api - The Jitsi Meet iframe api object. */ - constructor(api) { + constructor(iframe, api) { this._api = api; - this._iframe = this._api.getIFrame(); + this._iframe = iframe; this._onScreenSharingStatusChanged = this._onScreenSharingStatusChanged.bind(this); this._sendCloseTrackerEvent = this._sendCloseTrackerEvent.bind(this); @@ -153,8 +156,9 @@ class ScreenShareRenderHook { * Initializes the screen sharing electron specific functionality in the renderer process containing the * jitsi meet iframe. * + * @param {iframe} iframe - The jitsi Meet iframe object. * @param {JitsiIFrameApi} api - The Jitsi Meet iframe api object. */ -module.exports = function setupScreenSharingForWindow(api) { - return new ScreenShareRenderHook(api); +module.exports = function setupScreenSharingForWindow(iframe, api) { + return new ScreenShareRenderHook(iframe, api); };