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
Navaron Bracke
2024-04-09 11:23:41 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1c7ebe264c1949aa9e33a9167ccbadba47af4810
1c7ebe26
1 parent
31fcad59
remove additional JSAny cast
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
lib/src/web/mobile_scanner_web.dart
lib/src/web/mobile_scanner_web.dart
View file @
1c7ebe2
...
...
@@ -89,7 +89,7 @@ class MobileScannerWeb extends MobileScannerPlatform {
Future
<
MediaStream
>
_prepareVideoStream
(
CameraFacing
cameraDirection
,
)
async
{
if
(
(
window
.
navigator
.
mediaDevices
as
JSAny
?)
.
isUndefinedOrNull
)
{
if
(
window
.
navigator
.
mediaDevices
.
isUndefinedOrNull
)
{
throw
const
MobileScannerException
(
errorCode:
MobileScannerErrorCode
.
unsupported
,
errorDetails:
MobileScannerErrorDetails
(
...
...
@@ -104,7 +104,7 @@ class MobileScannerWeb extends MobileScannerPlatform {
final
MediaStreamConstraints
constraints
;
if
(
(
capabilities
as
JSAny
)
.
isUndefinedOrNull
||
!
capabilities
.
facingMode
)
{
if
(
capabilities
.
isUndefinedOrNull
||
!
capabilities
.
facingMode
)
{
constraints
=
MediaStreamConstraints
(
video:
true
.
toJS
);
}
else
{
final
String
facingMode
=
switch
(
cameraDirection
)
{
...
...
@@ -113,7 +113,9 @@ class MobileScannerWeb extends MobileScannerPlatform {
};
constraints
=
MediaStreamConstraints
(
video:
MediaTrackConstraintSet
(
facingMode:
facingMode
.
toJS
)
as
JSAny
,
video:
MediaTrackConstraintSet
(
facingMode:
facingMode
.
toJS
,
),
);
}
...
...
Please
register
or
login
to post a comment