Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Cory Davis
2023-02-12 22:04:41 -0500
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
760aca28ac665b020fe961ca111364ca0003e1fa
760aca28
1 parent
ec94f6de
allow more recent device types to be discovered if the current version of iOS su…
…pports that discovery
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
ios/Classes/MobileScanner.swift
ios/Classes/MobileScanner.swift
View file @
760aca2
...
...
@@ -122,7 +122,11 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
textureId
=
registry
?
.
register
(
self
)
// Open the camera device
if
#available(iOS 10.0, *)
{
if
#available(iOS 13.0, *)
{
device
=
AVCaptureDevice
.
DiscoverySession
(
deviceTypes
:
[
.
builtInTripleCamera
,
.
builtInDualWideCamera
,
.
builtInDualCamera
,
.
builtInWideAngleCamera
],
mediaType
:
.
video
,
position
:
cameraPosition
)
.
devices
.
first
}
else
if
#available(iOS 10.2, *)
{
device
=
AVCaptureDevice
.
DiscoverySession
(
deviceTypes
:
[
.
builtInDualCamera
,
.
builtInWideAngleCamera
],
mediaType
:
.
video
,
position
:
cameraPosition
)
.
devices
.
first
}
else
if
#available(iOS 10.0, *)
{
device
=
AVCaptureDevice
.
DiscoverySession
(
deviceTypes
:
[
.
builtInWideAngleCamera
],
mediaType
:
.
video
,
position
:
cameraPosition
)
.
devices
.
first
}
else
{
device
=
AVCaptureDevice
.
devices
(
for
:
.
video
)
.
filter
({
$0
.
position
==
cameraPosition
})
.
first
...
...
Please
register
or
login
to post a comment