- Local time
- Sep 24, 2019
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.
I am wondering if there is a way to detect this before it happens? Ideally, I would like a function that checks if there's permission to play audio (from first interaction or the browser doesn't care) and if so, play it, otherwise, show a play audio button which would trigger the function again.
Does anyone know if that's possible?