Browser denying javascript play()
问题 I have a page with an input field for scanning products. When a barcode is scanned or a SKU is typed into the field, an ajax request is made and the application plays either a success or an error sound depending on the response using HTMLMediaElement.play(). sounds.error.play(); This was working fine a while ago but now I get this error: ⚠ Autoplay is only allowed when approved by the user, the site is activated by the user, or media is muted. Followed by: NotAllowedError: The play method is