0
I have a problem in my system. I happen to have a jQuery script that simply, after a database query, plays an audio in the browser.
$('body').append('<embed src="audio/found.mp3" hidden="true" autostart="true" type="audio/mp3">');
It turns out that if the guide is not focused on the browser, that is, if I’m not with the site tab open, or I’m in another program, the audio doesn’t play, and I need it to play at all times, without exceptions. The site already has HTTPS (which I thought was a limiter of this function), but even so, it won’t. Is there a library that helps me with this and ensures that the audio will always be played?
can be a browser policy, happens at all? why are you using
<embed>
and not the tag<audio>
.– Leandro Angelo
I already tried to use the audio and gave the same error. Then I changed the tag but same thing..
– Vitor Leite
Vc is using setTimeout or setInterval?
– Sam
No. The audio is played right after the ajax sequence.
– Vitor Leite
Vitor, you managed to solve ?
– RXSD