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-01-29 16:22:24 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
19e65cca9d2622443857c85d85a57a9a755dffae
19e65cca
1 parent
b9b99e8a
ensure there is only one video element as child
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
lib/src/web/mobile_scanner_web.dart
lib/src/web/mobile_scanner_web.dart
View file @
19e65cc
...
...
@@ -240,6 +240,18 @@ class MobileScannerWeb extends MobileScannerPlatform {
_handleMediaTrackSettingsChange
,
);
final
HTMLVideoElement
videoElement
;
// Attach the video element to the DOM, through its parent container.
// If a video element is already present, reuse it.
if
(
_divElement
!.
children
.
length
==
0
)
{
videoElement
=
document
.
createElement
(
'video'
)
as
HTMLVideoElement
;
_divElement
!.
appendChild
(
videoElement
);
}
else
{
videoElement
=
_divElement
!.
children
.
item
(
0
)!
as
HTMLVideoElement
;
}
await
_barcodeReader
.
start
(
startOptions
,
videoElement:
videoElement
,
...
...
Please
register
or
login
to post a comment