Skip to content

[Question || Bug] How to replace 'placeScreenSharingCall' by 'setScreensharingEnabled' to initiate a screensharing call w/o using Electron desktopCapturer #1898

@menturion

Description

@menturion

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions