matrix-js-sdk: v12.4.0
Hi,
I am trying to replace the former call.placeScreenSharingCall() by the newly introduced call.setScreensharingEnabled(true) (see #1685) to initiate a screensharing call (i.e. not to add screensharing to an existing voice call).
I am constantly getting an exception:
Set screensharing enabled? true using replaceTrack()
logger.js:59 Electron desktopCapturer is not available...
logger.js:59 Getting screen stream using getDisplayMedia()...
listener.js:78 Error: Failed to get screen-sharing stream: : TypeError: Cannot read properties of undefined (reading 'replaceTrack')
at MatrixCall.setScreensharingEnabledWithoutMetadataSupport (call.js:1096)
Previously (v12.2.0), I just needed to call await call.placeScreenSharingCall() and to select the browser's native screen selector to start a screensharing call.
What is a simple replacement of ...
await call.placeScreenSharingCall();
using ...
await call.setScreensharingEnabled(
!call.isScreensharing(),
...
);
in case of the absence of the Electron desktopCapturer?