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
Daniel Newton
2022-03-23 14:02:39 +1300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
466089016521ede6f7483ade61c3fecb122ff265
46608901
1 parent
7cb065c6
use video options object directly
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
lib/mobile_scanner_web_plugin.dart
lib/mobile_scanner_web_plugin.dart
View file @
4660890
...
...
@@ -106,18 +106,15 @@ class MobileScannerWebPlugin {
Map
?
capabilities
=
html
.
window
.
navigator
.
mediaDevices
?.
getSupportedConstraints
();
if
(
capabilities
!=
null
&&
capabilities
[
'facingMode'
])
{
UserMediaOptions
constraints
=
UserMediaOptions
(
video:
VideoOptions
(
var
constraints
=
VideoOptions
(
facingMode:
(
cameraFacing
==
CameraFacing
.
front
?
'user'
:
'environment'
),
width:
{
'ideal'
:
4096
},
height:
{
'ideal'
:
2160
},
)
)
;
);
// test just using a raw map
var
videoConstraints
=
{
'facingMode'
:
cameraFacing
==
CameraFacing
.
front
?
'user'
:
'environment'
};
_localStream
=
await
html
.
window
.
navigator
.
getUserMedia
(
video:
videoC
onstraints
);
await
html
.
window
.
navigator
.
getUserMedia
(
video:
c
onstraints
);
}
else
{
_localStream
=
await
html
.
window
.
navigator
.
getUserMedia
(
video:
true
);
}
...
...
Please
register
or
login
to post a comment