I'm using this code but when it gets the source it always moves that window to the front which is kind of annoying, but I don't see any options in this code that make it move to the front so not sure how to prevent it.
It moves the source to the front, in front of my app and puts the focus on that window rather than my app, so every time I get the source I have to click back on my app again.
navigator.mediaDevices.getUserMedia({
audio: false,
video: {
mandatory: {
chromeMediaSource: 'desktop',
chromeMediaSourceId: desktop_id,
minWidth: 2480,
maxWidth: 2480,
minHeight: 1440,
maxHeight: 1440
}
}
}).then(gotStream).catch(getUserMediaError);
EDIT: To avoid any confusion, this is the code from the Desktop Capturer app here https://github.com/hokein/electron-sample-apps/tree/master/desktop-capture