[feat] screensharing without pop up window
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
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.