Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 29
[SOLVED] Can I play background music with confirm() in js?
When I try it normally it gives an error that play() function can only be initiated by user gesture... But I did kind of the same thing in this code of mine... but with swal alert https://code.sololearn.com/W153Wjsx8oFM/?ref=app
13 Respostas
+ 19
From What I've seen, confirm is not counted as a user gesture. You need an event (touchstart,click etc) for that. Swal alert is actually an HTML element which you are clicking (user gesture).
+ 11
Aravind maybe...
+ 11
Yes Atulš¦ bhaiya ... actually not feeling like creating a whole custom alert all by myself šš¤£
+ 10
Bartikaš¶ just create one in no time hardly take 1 hour and use in every code it will be ur signature alert too :)
+ 8
Bartikaš¶ u can make custom alert with js :D
https://code.sololearn.com/WOaWO5tHdv8o/?ref=app
confirm , alert aren't user gesture and Android don't allow autoplay of DOM elements
+ 8
Atulš¦ 1 hour !!!!! š±
+ 7
Bartikaš¶ Or.. You can just use Atul's confirm into ur code, š
+ 7
Thnx Sick LĢ
Ģ²iĢ
Ģ²nĢ
Ģ²eĢ
Ģ² BĢ¶rĢ¶oĢ¶š”ļø [TheBloodCoders] !!!! š
+ 6
Same error occured in my game, I guess it's sl issue! Isn't it?
+ 2
Kode Krasher i agree with you but the whole point is autoplay here and that's not a " browser " issue its actually a "feature" of google ie android
You can autoplay in Ios with some simple hacks but in android its not possible
"""
https://developers.google.com/web/updates/2016/07/autoplay
"""
You could read this
And yeah i know about raw and dl i just wanted to demonstrate that custom alert thanks š for pointing that out
+ 2
Yes you can
- 3
āš šØ ššš š šššš š„ššš¤ šš š£š š„š š„š£ššš¤ššš£ ššš„šššš¤ š„š ššŖ ššššš šššš š¦šš„..
https://code.sololearn.com/W4TeM9l6Oqi8/
Uzodimma Joseph Ifeanyi Ask by creating a new question. Do not hijack existing threads.