Open jankeso opened 2 months ago
The Trying to play video that is already playing.
message is a log from ZXing and should be harmless (it calls play()
on the HTMLVideoElement
, which was already playing)
Could you provide a sample of the barcode that you are trying to scan?
I am having a the same issue as well. I am not able to get any barcodes to scan on the web.
Here is a sample of one:
I was having same problem then i chnaged to version 4.0.1 and now it's working on web
I was having same problem then i chnaged to version 4.0.1 and now it's working on web
I tried this myself after you posted and I'm seeing the same behaviour as well. It seems like the update to version 5.0 broke web functionality.
I'm using version 5.1.1, the browser is most recent Chrome on Windows 10. I tried a simple approach with onDetect in MobileScanner and the controller. Here's the widget code for simple onDetect version:
` class BarcodeScanner extends StatefulWidget { const BarcodeScanner({super.key});
@override _BarcodeScannerState createState() => _BarcodeScannerState(); }
class _BarcodeScannerState extends State with WidgetsBindingObserver {
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( leading: IconButton( icon: const Icon(Icons.arrow_back), onPressed: () => Navigator.of(context).pop(), ), title: const Text('Scan a code'), ), body: SafeArea( child: Stack( children: [ MobileScanner( onDetect: _handleBarcode, errorBuilder: (context, error, child) { return ScannerErrorWidget(error: error); }, ), ], ), ), ); }
void _handleBarcode(BarcodeCapture barcode) { print("scanned barcode"); print(barcode.barcodes); } } `
This is what I get in the console for both onDetect and controller: scanned barcode [] Trying to play video that is already playing.
What am I missing?