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

[AVCaptureDevice setTorchMode:] The passed torchMode 1 is not supported - use -isTorchModeSupported: to discover valid torch modes #167

Closed
YangPeiqiu opened this issue Nov 23, 2018 · 7 comments

Comments

@YangPeiqiu
Copy link

YangPeiqiu commented Nov 23, 2018

设备不支持闪光灯,例如ipad设备,需要在闪光灯打开的代码部分先做判断

  • (void)setTorch:(BOOL)torch {

    [self.input.device lockForConfiguration:nil];
    if ([self.input.device hasTorch]) {
    self.input.device.torchMode = torch ? AVCaptureTorchModeOn : AVCaptureTorchModeOff;
    }
    [self.input.device unlockForConfiguration];
    }
    此处是否应该要这样支持下呢?目前没有的

@624990742
Copy link

你好,我也遇到了同样的问题,请问你把判断具体加到哪一个地方了呢?

@zhyizhou
Copy link
Contributor

@624990742 更新一下库试试看, 这个判断合并到master了.

@624990742
Copy link

好的,我更新一下

@624990742
Copy link

你好,我的最新版本就是2.3的,好像没有更新过来啊

zhyizhou added a commit to zhyizhou/LBXScan that referenced this issue Aug 12, 2019
@zhyizhou
Copy link
Contributor

@624990742 刚PR作者了, 等他操作更新.

MxABC added a commit that referenced this issue Aug 12, 2019
@zhyizhou
Copy link
Contributor

@624990742 可以尝试安装master分支, 或者手动修改.

pod 'LBXScan', git:"https://github.com/MxABC/LBXScan.git"

@MxABC
Copy link
Owner

MxABC commented Jul 23, 2020

已更新2.4.1版本,ZBar删除了UIWebView,另外Demo提供了扫码控制器,建议基于Demo提供的扫码控制器自行调试修改

@MxABC MxABC closed this as completed Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants