electron-sample-apps
electron-sample-apps copied to clipboard
[Desktop Capture] Why use GetUserMedia with chromeMediaSource : 'desktop', focus on the window application?
Hi.
Like in the Desktop Capture example, I use getUserMedia() (or webkitGetUserMedia()) to get the Desktop app video stream:
navigator.mediaDevices
.getUserMedia({
audio: false,
video: {
mandatory: {
chromeMediaSource: 'desktop',
chromeMediaSourceId: source.id,
minWidth: 1920,
maxWidth: 1920,
minHeight: 1080,
maxHeight: 1080,
maxFrameRate: 25,
},
},
})
.then()
.catch();
When I use this function, the window selected is focused and go to the foreground. How to avoid this behaviour? I need to stay focused on my Electron application.
Thanks a lot.
Jo.