AVCaptureDevice doesnt find any device

谁说我不能喝 提交于 2019-12-07 13:31:09

问题


This line of code is the problem I got today (macOS app):

NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];

After I update Xcode, the system is alway got me empty devices array.

The thing is, the old projects(created before the update) work as expected.

What's going on here...?

Does anyone has the same problem?

------------UPDATE------------

I found this not just happened to my mac, also on the company's.

And it does affect my work.


回答1:


I think I found the answer...

Target Settings / Capabilities / App sandbox / Hardware




回答2:


This problem only happens on the Mac OS 10.13, Mac OS 10.12 is normal. I have the same problem, and there's no solution yet. AVCaptureDevice not found video device, i think it's apple that added permissions on the camera on 10.13.



来源:https://stackoverflow.com/questions/46426003/avcapturedevice-doesnt-find-any-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!