BarcodeDetector (currently) has pretty poor performance. I'm sure that will eventually be fixed, though. I've had great success with qr-scanner and a web worker, though....
Edit: Just updated my post with the codepen from the polyfill author: https://codepen.io/undecaf/pen/LYzXXzg
It is butter smooth with EAN barcode when using the builtin webcam on my Macbook (720p on a 2019 MBP16)