1
with the new Chrome update function autoplay
audio does not work, would like to know how to force autoplay, already tried so:
document.getElementById("controles").setAttribute('autoplay', true);
Thus:
$("#controles")[0].autoplay = true;
And so:
var controles = document.getElementById("controles");
function enableAutoplay() {
controles.autoplay = true;
controles.load();
}
And no way it worked, anyone knows why?
What is the html markup of this player ?
– Atila Silva
@Atila Silva
<audio src="kalimba.mp3" autoplay id="controles"></audio>
– goio
The attribute
autoplay
right in the tag didn’t work ? You’re testing on desktop or mobile ?– Isac
@Isac didn’t work at all, I’m testing on desktop
– goio
Put the way you have the
html
to understand if the mistake comes from– Isac
I don’t understand what you mean
– goio
The archive
kalimba.mp3
that you are trying to load exists ? It is in the same folder as the html file ? It works in other browsers ? The html specified by you<audio src="kalimba.mp3" autoplay id="controles"></audio>
works without even requiring javascript, so the problem comes from something else– Isac
actually, where ta music kalimpa.mp3 in place will a streaming, yes in other browsers work, it does not only work with the
autoplay
so I had to force it, even though it’s not playing, and streaming problem is not, because it touches other browsers, except on Chrome– goio