electron-sample-apps icon indicating copy to clipboard operation
electron-sample-apps copied to clipboard

[Desktop Capture] Why use GetUserMedia with chromeMediaSource : 'desktop', focus on the window application?

Open jbeurel opened this issue 6 years ago • 0 comments

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.

jbeurel avatar Dec 11 '18 15:12 jbeurel