Closed zeinab-sheikhi closed 3 years ago
@zeinab-sheikhi When running the example with flutter run -d chrome
, you can get navigator.mediaDevices
which is used to open your camera.
However, if you run the example with flutter run -d chrome --web-hostname 192.168.1.72 --web-port 3000
, the navigator.mediaDevices
is undefined.
There is nothing wrong with Barcode Scanner. The issue is caused by the security policy of Chrome. If you host the example with HTTPS, it should work.
Hi, I have run example directory from your project on web, with this command: flutter run -d chrome --web-hostname 192.168.1.72 --web-port 3000 (I want to test this as PWA on ios phones, so I specified my laptop's ip address.) when I want to scan barcodes via video stream, it opens file chooser and acts like Barcode Reader. but When I run it with flutter run -d chrome, it works as expected and ask camera permission and start video streaming flutter doctor is: Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.5.1, on macOS 11.2.3 20D91 darwin-x64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] Connected device (1 available) • No issues found!
what is wrong with Barcode Scanner on web?