+ 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 Answers
+ 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.