Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera feed not loading on macOS Catalina #253

Closed
charlielee opened this issue Jan 18, 2020 · 10 comments
Closed

Camera feed not loading on macOS Catalina #253

charlielee opened this issue Jan 18, 2020 · 10 comments
Assignees
Labels
bug Things that are broken
Milestone

Comments

@charlielee
Copy link
Owner

charlielee commented Jan 18, 2020

The camera feed does not seem to be working on macOS 10.14 or 10.15. A bit of a major issue!

I think the issue is that the camera permission request dialogue is not triggered. See:
https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos

Possibly some solutions listed here:
https://stackoverflow.com/questions/56084303/opencv-command-line-app-cant-access-camera-under-macos-mojave

Probably need to mess about with the generated plist file. Probably something to handle within https://github.com/charlielee/nwjs-packager

@charlielee charlielee added the bug Things that are broken label Jan 18, 2020
@charlielee
Copy link
Owner Author

charlielee commented Jan 18, 2020

Electron handles this nicely it seems:
https://electronjs.org/docs/api/system-preferences#systempreferencesaskformediaaccessmediatype-macos

A related issue:
electron/electron#15985

I'm struggling to find anything similar for nw.js

@charlielee
Copy link
Owner Author

Maybe related to nwjs/nw.js#7229

@charlielee
Copy link
Owner Author

@arudnev
Copy link

arudnev commented Jan 22, 2020

I just stumbled upon this ticket when I realized that we had similar issue for a while.
Not sure how it worked for us on macOS Mojave, but after we added notarization support for app to work on macOS Catalina we noticed that camera and microphone permissions are not requested.
Adding missing entitlements as part of codesign process seems to resolve the issue.

nwjs/nw.js#7330

So, something like that as entitlements file should fix it

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.device.camera</key>
    <true/>
    <key>com.apple.security.device.audio-input</key>
    <true/>
    <key>com.apple.security.device.microphone</key>
    <true/>
    <key>com.apple.security.automation.apple-events</key>
    <true/>
    <key>com.apple.security.cs.allow-dyld-environment-variables</key>
    <true/>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
    <true/>
    <key>com.apple.security.cs.disable-executable-page-protection</key>
    <true/>
    <key>com.apple.security.cs.disable-library-validation</key>
    <true/>
  </dict>
</plist>

@charlielee
Copy link
Owner Author

@arudnev thank you for your advice! Much appreciated. Boats Animator is not a signed application so there isn't a codesign process as such.

Would the solution to create a Entitlements.plist file in package?

@charlielee
Copy link
Owner Author

I've found the issue and reported it to nw-builder here: nwutils/nw-builder#524

@charlielee
Copy link
Owner Author

charlielee commented Jan 26, 2020

Issues like this really do make me consider moving this project to Electron. nw-builder isn't very actively maintained and NW.js doesn't really have a supported alternative. A lot of functionality that would simply be available in https://github.com/electron/electron-packager I am having to write myself in https://github.com/charlielee/nwjs-packager

@arudnev
Copy link

arudnev commented Jan 26, 2020

Yeah, we've been using our fork (mostly signing, notarization, tune up of windows installer) of https://github.com/evshiron/nwjs-builder-phoenix, which is currently nwjs recommended packager.

@charlielee
Copy link
Owner Author

This should be fixed in the exportVideo branch since I have extensively rewritten https://github.com/charlielee/nwjs-packager to allow the ffmpeg dependency to be included in this. This rewrite removes the nw-builder dependency.

@charlielee charlielee mentioned this issue May 5, 2020
8 tasks
@charlielee charlielee self-assigned this May 11, 2020
@charlielee
Copy link
Owner Author

Fixed in #258

@charlielee charlielee added this to the v0.10 milestone Oct 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that are broken
Projects
None yet
Development

No branches or pull requests

2 participants