0
Why is my audio not playing?
I want to make my audio play, like a magic audio. It should be invisible and play automatically https://code.sololearn.com/Wk2mYHAPJN1S/?ref=app
5 Respostas
+ 2
Add control attribute in Audio tag
<audio controls autoplay loop>
<source src="https://www.computerhope.com/jargon/m/example.mp3" type="audio/mpeg">
+ 2
SAN no I want to make it invisible. but even if i add, it's not auto-playing
+ 1
Try this
window.onclick=()=>{
document.getElementById('audio').play();
}
+ 1
SAN I don't know CSS and JavaScript, I only know HTML. actually why didn't my code work? because it's correct and should work right?
+ 1
Rishi
These are some threads discussing similar issue. Maybe one of them was relevant.
P.S. I used "autoplay not working" search term under "Most Popular" scope.
https://www.sololearn.com/Discuss/2330298/?ref=app
https://www.sololearn.com/Discuss/2059721/?ref=app
https://www.sololearn.com/Discuss/998457/?ref=app
https://www.sololearn.com/Discuss/1191642/?ref=app