Skip to content

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

Description

@jbeurel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions