Beaker: getUserMedia not working on macOS

Created on 14 May 2020  Â·  10Comments  Â·  Source: beakerbrowser/beaker

While trying to get https://brie.fi/ng working with Beaker it turned out, that getUserMedia to access video and audio of the device is not working.

Reproduce by using https://webrtc.github.io/samples/src/content/getusermedia/gum/

You'll get: DOMException: Could not start video source

bug macos

Most helpful comment

Aha, solved it. I missed some macOS entitlements.

All 10 comments

Thanks for filing. This looks like a bug - it's worked for me elsewhere so I'll have to see what's going wrong here.

Thanks for looking into this. I also tested it on Windows 10 and there it works fine.

This is the setup where it did not work, maybe one of these thousands Catalina related issues ;)

CleanShot 2020-05-15 at 09 36 <a href="49@2x">49@2x</a>

I copy/pasted the video streaming code into my personal profile page and get the same error. Beaker on macOS High Sierra, so it's not Catalina related. The error is hardly helpful - just the DOMException message given above.

Aha, solved it. I missed some macOS entitlements.

Awesome! In a native app you also need to add some description in Info.plist why you would like to use the camera etc. A quick google search brought up this one, don't know if it might be relevant as well: https://github.com/electron/electron/issues/19307#issuecomment-524314643

{
  "build": {
    "mac": {
      "entitlements": "build/entitlements.mac.plist",
      "extendInfo": {
        "NSCameraUsageDescription": "This app requires camera access to record video.",
        "NSMicrophoneUsageDescription": "This app requires microphone access to record audio."
      }
    }
  }
}

@holtwick Ew gross, thanks so much for letting me know. Reopening till I handle that.

I can confirm it is working with the latest release candidate.

The first time though I'll be asked twice to allow video, first by beaker and second by macOS. This only happens once, the first time you ever access the camera. I think this is ok, but probably something to keep in mind when doing the fine tune of user experience in Beaker 2.0 ;)

@pfrazee thanks a lot for fixing this issue. I'm looking forward to use the extra magic of beaker in my projects soon.

Happy to fix it, thank you for reporting it! Yeah I don’t know if I can stop macOS from asking for that additional perm. It should only be once

On May 21, 2020, at 1:23 AM, Dirk Holtwick notifications@github.com wrote:


I can confirm it is working with the latest release candidate.

The first time though I'll be asked twice to allow video, first by beaker and second by macOS. This only happens once, the first time you ever access the camera. I think this is ok, but probably something to keep in mind when doing the fine tune of user experience in Beaker 2.0 ;)

@pfrazee thanks a lot for fixing this issue. I'm looking forward to use the extra magic of beaker in my projects soon.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

I don't think it will be possible to suppress this request, since it is a security feature. Other browser have to go through this as well anyway. I just thought it might be nice to prepare the user that she will be asked again to give access. Maybe as an extra notice in the first box if it is known that the user did not yet give access to the camera in general, maybe like:

"After giving the website access to the camera and microphone, you will need to confirm the system message, to give access to Beaker in general. This will only happen once and can be revoked by you in the System Settings / Privacy at any time."

CleanShot 2020-05-21 at 08 43 <a href="04@2x">04@2x</a>

You can even open the system preferences programmatically via this URL:

x-apple.systempreferences:com.apple.preference.security?Privacy_Camera

See https://stackoverflow.com/a/51886562/140927

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronshaf picture aaronshaf  Â·  4Comments

pmario picture pmario  Â·  4Comments

LWFlouisa picture LWFlouisa  Â·  4Comments

pmario picture pmario  Â·  4Comments

dasanchez picture dasanchez  Â·  3Comments