tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] screensharing without pop up window

Open vangork opened this issue 1 year ago • 1 comments

Describe the problem

Currently to share the screen, we can call navigator.mediaDevices.getDisplayMedia which will popup a mandatory window to ask user to choose which screen to share.

Describe the solution you'd like

Is there possible to get the screenid from the tauri api(like electron desktopCapturer), and call navigator.getUserMedia to produce the mediastream with the screenid directly like following so as to avoid the popup window?

const stream = navigator.getUserMedia({
    audio: false,
    video: {
        mandatory: {
            chromeMediaSource: 'desktop',
            chromeMediaSourceId: screenId,
        }
    }
})

Alternatives considered

No response

Additional context

No response

vangork avatar Oct 08 '24 08:10 vangork

The webviews don't have any apis that would make this possible as far as i can see. For Windows there's this tracking issue for example https://github.com/MicrosoftEdge/WebView2Feedback/issues/2442 (doesn't look like it but check the linked issues at the bottom).

getDisplayMedia is more or less unsupported (at least officially) on macOS so finding any discussions about anything somewhat related is pretty hard but judging by the apis that do exist (including private ones) this doesn't seem possible on macOS either.

No webrtc support on Linux so no need to look into that.

FabianLars avatar Oct 17 '24 20:10 FabianLars