Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 2
Audio in html
In my audio html tag I add autoplay and itās not working when i put controls only it works <audio autoplay=āautoplayā> <source src=ārandom.mp3ā type=āaudio/mpegā> <source src=ārandom.oggā type=āaudio/oggā> </audio> Whatās wrong,not working in any browser
2 Respostas
+ 2
Hi Slavisa,
To get your issue fixed you need to get rid of autoplay="autoplay"
Therefore the autoplay attribute wil work when u just insert 'autoplay' without a value:
<audio id="your_id" controls autoplay \>
ADDITIONAL:
Since you did not implement JS to your audio tag which the controls attribute interact with, Here is a source that will help you to get this working with JS: https://www.w3schools.com/jsref/prop_audio_autoplay.asp
Only HTML for the audio tag will be very limited to use.
Hope this will fix your issueš
https://code.sololearn.com/WcA28BVWTfq4/?ref=app
+ 1
I don't know if this will work but try including the "autoplay" attribute alone without this part '="autoplay"'.
If you can provide a link to your code I might be able to help you more.