tauri-apps/tauri

[feat] screensharing without pop up window

vangork opened this issue · 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