Session preset for unsupporting 4K devices fixed

This commit is contained in:
Vladimir Makarov 2021-12-15 17:19:10 +05:00
parent 3ab48fced3
commit 8a60b59c62
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'QRCodeReader'
s.version = '1.0.5'
s.version = '1.0.6'
s.summary = 'iOS framework contain core view elements and logic component for work with QR codes.'
s.homepage = 'https://github.com/TouchInstinct/QRCodeReader-ios'

View File

@ -143,7 +143,11 @@ open class QRCodeReader: NSObject, AVCaptureMetadataOutputObjectsDelegate {
// MARK: - Private Methods
private func configureDefaultComponents() {
session.sessionPreset = .hd4K3840x2160
if session.canSetSessionPreset(.hd4K3840x2160) {
session.sessionPreset = .hd4K3840x2160
} else {
session.sessionPreset = .photo
}
for output in session.outputs {
session.removeOutput(output)