+ 1
{SOLVED}Please Help Me With Audio Element
How Can I Make Audio AutoPlay In HTML?... I kept autoplay in audio element its not working. How can i do it? Please say me..
16 odpowiedzi
+ 11
check this code
https://code.sololearn.com/Wj46ZL12GJo8/?ref=app
+ 9
Oh!!! Okk wait
+ 8
Mr.Kalyankumar check again,it's working bro
+ 8
Mr.Kalyankumar check again bro
it's will take some time because your music is from dropbox
I added body.onclick event when you click anywhere on window the audio will starts playing...
+ 8
Hii Mr.Kalyankumar
If you are asking to play "audio" automatically then you can use autoplay loop attributes..
As an example -
https://code.sololearn.com/W2D5Woet5ww2/?ref=app
And yea don't forget to have a look on the lesson provided by sololearn on "the audio element"
Hope this helps ✌️
+ 3
Mr.Kalyankumar please attach your code attempt and i will try to help you.
+ 2
Matiyas please help me
+ 2
Hmm.. ok😔
+ 2
Piyush[21 Dec❤️] i tried it and the audio is playing, but not automatically... I have learnt the audio lesson from html, it wasn't working so i have requested a question, but ᕙ(@°▽°@)ᕗ {inactive} bro has solved my problem ☺️
+ 1
ᕙ(@°▽°@)ᕗ {inactive} its not working(your code)..... 😔.. i tried that before.,
+ 1
Audio is playing, but it's not playing automatically... Im asking, how to make it to play automatically without clicking on play button... Bro😔
+ 1
This time I cant even audio☹️🥺😭, btw can u speak hindi?
+ 1
ᕙ(@°▽°@)ᕗ {inactive} yes bro it's working... Thank you 😊 soo much☺️☺️
+ 1
You can use loop is infinity your audio no stop
0
Mr.Kalyankumar
Browsers doesn't allow to play an audio without any user gesture.
You can do this with JavaScript
So, in JavaScript you can't write audio.play() directly. You have to use an event to call it like mouse move, scroll, click, etc.